I have a string that has some Environment.Newline in it. I'd like to strip those from the string and instead, replace the Newline with something like a comma.
What would be, in your opinion, the best way to do this using C#.NET 2.0?
I have a string that has some Environment.Newline in it. I'd like to strip those from the string and instead, replace the Newline with something like a comma.
What would be, in your opinion, the best way to do this using C#.NET 2.0?
Don't reinvent the wheel - just use myString.Replace(Environment.NewLine, ",")
Why not:
The best way is the builtin way: Use
string.Replace
. Why do you need alternatives?Like this: