RE: replacing " within a string

From: Sreejith S S Nair (SreejithSSNair_at_discussions.microsoft.com)
Date: 08/06/04


Date: Fri, 6 Aug 2004 05:05:02 -0700

hi,
  i am really sorry. my previous post is wrong.

this is the correct answer.

In your code you are trying to replace few characters. That's fine.

myString.Replace("\"", """),

But you need to know one importent thing in String class is that

string is immutable. That means if you try to update one variable of that
type string it won't update the real value.

string SSS=myString.Replace("\"", """),

Now you will get the result on SSS.
If you try to print the value of myString it won't change the old value.

Try this example and try to view the value of myString after printing SSS.



Relevant Pages


Quantcast