Click here to Skip to main content
15,851,453 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi I need to replace string \" with letter s.
I dont need this mstring.Replace("\","s");
mystring.Replace("\"","s");
please help me
Thanks
Posted
Comments
NeverJustHere 3-Nov-14 2:42am    
Why do you not need this mystring.Replace("\"","s"); ??
syed shanu 3-Nov-14 2:42am    
Can you improve your question .Its not clear about your requirement.

1 solution

Try:
C#
myString = myString.Replace("\\\"", "s");
Or
C#
myString = myString.Replace(@"\""", "s");
Either should do it

Or (if you are allergic to String.Replace perhaps) then there are always Regexes:
C#
myString = Regex.Replace(myString, "\\\\\"", "s");


If that isn't what you want, then you need to explain in more detail.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900