remove \n at the end of string c# code example
Example: c# remove newline from string
// Remove all newlines from the 'example' string variable
string cleaned = example.Replace("\n", "").Replace("\r", "");
// Remove all newlines from the 'example' string variable
string cleaned = example.Replace("\n", "").Replace("\r", "");