0

I am currently trying to replace a string I have in my quote and I have looked for several different solutions but without any success. this is the string

string line2 = "93100;7;16426;\"PZ16426 1442ab98 (SA) 402A Pedal 1 NO y NC fallo\";\"2016-07-26 08:28:45.000\";\"2016-08-13 10:15:54\"";

And these are my attempts:

line2.Replace(@"\", string.Empty);
line2.Replace(@"\", "");
line2.Replace(@"""", string.Empty);
line2.Replace(@"""", "");

What am I doing wrong?

0

1 Answer 1

2

The replace method does not replace the contents in-place, but returns the string with the characters replaced instead. So instead of

string line2 = "abba";
line2.Replace("a", "e");

you should write

string line2 = "abba";
line2 = line2.Replace("a", "e");
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.