How would you normalize all new-line sequences in a string to one type?
I\'m looking to make them all CRLF for the purpose of email (MIME documents). Ideally this w
Simple variant:
Regex.Replace(input, @"\r\n|\r|\n", "\r\n")
For better performance:
static Regex newline_pattern = new Regex(@"\r\n|\r|\n", RegexOptions.Compiled); [...] newline_pattern.Replace(input, "\r\n");