c# remove enter from string 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", "");