How can I replace Line Breaks within a string in C#?
C# – Replace Line Breaks in a String C#
cnetstring
Related Topic
- C++ – How to iterate over the words of a string
- Java – How to read / convert an InputStream into a String in Java
- C# – How to get a consistent byte representation of strings in C# without manually specifying an encoding
- Python – Convert bytes to a string
- Javascript – How to make the first letter of a string uppercase in JavaScript
- Javascript – How to replace all occurrences of a string in JavaScript
- Javascript – How to check whether a string contains a substring in JavaScript
- Java – How to convert a String to an int in Java
Best Answer
Use replace with
Environment.NewLine
As mentioned in other posts, if the string comes from another environment (OS) then you'd need to replace that particular environments implementation of new line control characters.