input.Replace("\r\n", "\n").Replace("\r", "\n").Replace("\n", "\r\n")
This will work if the input contains only one type of line breaks – either CR, or LF, or CR+LF.
Related Posts:
- How can I convert String to Int?
- Substring index and length must refer to a location within the string
- How to convert UTF-8 byte[] to string
- .NET String.Format() to add commas in thousands place for a number
- Unrecognized escape sequence for path string containing backslashes
- .Net 4.8 Support for Windows 10 ends in 26 days?
- What is a NullReferenceException, and how do I fix it?
- How do I get a random YouTube video with the YouTube API?
- An existing connection was forcibly closed by the remote host
- What is a NullReferenceException, and how do I fix it?
- I am getting Failed to load resource: net::ERR_BLOCKED_BY_CLIENT with Google chrome
- IOException: The process cannot access the file ‘file path’ because it is being used by another process
- No connection could be made because the target machine actively refused it?
- Could not load file or assembly or one of its dependencies
- What does a lock statement do under the hood?
- Error : Could not load file or assembly or one of it’s dependencies
- Convert int to string?
- Converting string to byte array in C#
- Could not load file or assembly or one of its dependencies
- Priority queue in .Net
- What is the difference between int, Int16, Int32 and Int64?
- How can I add ” character to a multi line string declaration in C#?
- What is the purpose of nameof?
- How to open .dll files to see what is written inside?
- Windows .NET API / Windows 7 / Bluetooth communication with Intel Curie Arduino / Genuino 101
- Error 1053 the service did not respond to the start or control request in a timely fashion
- Get current folder path
- foreach vs someList.ForEach(){}
- System.web.mvc missing
- Nullable object must have a value?
- Access to the path is denied
- What does mscorlib stand for?
- Extension methods must be defined in a non-generic static class
- Metadata file ‘.dll’ could not be found
- C# List
to string with delimiter - WebForms UnobtrusiveValidationMode requires a ScriptResourceMapping for jquery
- Convert a list of strings to a single string
- “Error while trying to run project: Unable to start program”. Can run program only once. Then VS needs restart
- Add new item in existing array in c#.net
- How to resolve this System.IO.FileNotFoundException
- What is clr.dll on .Net framework and what does it do?
- what is this oleaut32.dll?
- Associating enums with strings in C#
- How do I declare a DefaultValue attribute whose value is an array of strings?
- How to resolve this System.IO.FileNotFoundException
- HttpWebRequest-The remote server returned an error: (400) Bad Request
- Extension methods must be defined in a non-generic static class
- C#: how to get first char of a string?
- How to use the “Using” statement in ASP.net razor webpages?
- How can I get the application’s path in a .NET console application?
- Reading settings from app.config or web.config in .NET
- How do I create a Shared Code project (.shproj)
- How to initialize a list of strings (List
) with many string values - There is no argument given that corresponds to the required formal parameter – .NET Error
- What does {0} mean when found in a string in C#?
- How do I remedy “The breakpoint will not currently be hit. No symbols have been loaded for this document.” warning?
- Invalid URI: The format of the URI could not be determined
- Multiple file-extensions searchPattern for System.IO.Directory.GetFiles
- C# – Illegal characters in path
- Could not establish trust relationship for SSL/TLS secure channel — SOAP
- Getting The ASCII Value of a character in a C# string
- Unable to read data from the transport connection : An existing connection was forcibly closed by the remote host
- How to make an HTTP POST web request
- How to add comments into a Xaml file in WPF?
- Why did I get the compile error “Use of unassigned local variable”?
- Reading CSV file and storing values into an array
- The remote server returned an error: (407) Proxy Authentication Required
- Merge two (or more) lists into one, in C# .NET
- How can I fix the error : “Unreachable Code Detected”
- How to open a new form from another form
- C# – How to convert string to char?
- Escape double quotes in a string
- What’s the @ in front of a string in C#?
- How do you sort a dictionary by value?
- EntityType has no key defined error
- HTML.ActionLink method
- Deep cloning objects
- Regular expression “^[a-zA-Z]” or “[^a-zA-Z]”
- How do I restart my C# WinForm Application?
- .NET graph library around?
- How to split() a delimited string to a List
- Creating a comma separated list from IList
or IEnumerable - Remove element of a regular array
- Best way to reverse a string
- An object reference is required to access a non-static member
- Task vs Thread differences
- Merging two arrays in .NET
- Best way to repeat a character in C#
- How can I know if a process is running?
- String was not recognized as a valid DateTime ” format dd/MM/yyyy”
- Fastest way to remove first char in a String
- Checking if a string array contains a value, and if so, getting its position
- XmlSerializer – There was an error reflecting type
- Run Command Prompt Commands
- windows could not start service on local computer error 5 access is denied
- Case insensitive ‘Contains(string)’
- Most efficient way to remove special characters from string
- Visual Studio keeps crashing
- Is there an equivalent to the Scanner class in C# for strings?
- How can I implement static methods on an interface?