Hi all,
I want to replace the perticular character from the string .
My string is
string original="(My friend name is "WALTERS K,SCHULTHIES SPL ","Lenny")";
Above is my string and i want to remove the comma only is in the first double quote from the string and replace with a single space.
If comma ocuur otherwise in my string then i want to keep this as it is. No change in the whole string .
then Output that i want is the
(My friend name is "WALTERS K SCHULTHIES SPL ","Lenny")
How i will do it?
Loading

YinPosted Oct 8, 2012, 4:36 AM
string original2 = original.Replace(","," ");
VulpesPosted Oct 11, 2012, 5:06 AM
You can also use a regular expression :
Mai Hu NaPosted Oct 9, 2012, 1:13 AM
for ex:-
i want index of 2nd comma(,) in below string
string original = "(My friend name is \"WALTERS K,SCHULTHIES SPL \",\"Lenny\",salunke)";
output expected is
(My friend name is "WALTERS K,SCHULTHIES SPL " "Lenny",salunke)
YinPosted Oct 8, 2012, 4:30 AM
string new_orig = Replace(original, ","," ");
R ACHUTHAPosted Oct 5, 2012, 3:04 AM
try the below one