replacing the beginning and end but not the same chars within a string
Posted
by
Jordan Trainor
on Stack Overflow
See other posts from Stack Overflow
or by Jordan Trainor
Published on 2012-12-16T03:55:06Z
Indexed on
2012/12/16
5:04 UTC
Read the original article
Hit count: 189
lines = "some stuff\"some other \"stuff\"\"";
lines = lines.Replace("\"", "\"");
lines = lines.Replace("\"", "\"");
in its current context and in its simplest form these two actions seem absolutely pointless but when I put this into code it will be not be pointless and will have a purpose other than replacing itself with itself.
OK so I have the String lines that has 4 escaped quotation marks and I wish to replace the first quote with a quote and the end quote with a quote how would I accomplish this without replacing any of the inner quotes?
© Stack Overflow or respective owner