I had a requirement where i need to insert an escape sequence in a given string variable, at places wherever a single quotes (\') appears. I tried using
I would use a StringBuilder object rather than manually concatinating the strings. At least you would get some performance improvement out of that if your strings are large.