Remove CRLF from string C#
To remove CRLF from a string in C# you can replace "\n
" and "\r
" with empty string.Example
using System;
public class Program
{
public static void Main() {
string pString = @"hello
user";
var str = pString.Replace("\n","").Replace("\r","");
Console.WriteLine(str);
}
}
Output
hello user