When you have a multi-line textbox that allows users to enter sentences, they might have entered some line breaks. Those line breaks need to be replaced with break line in HTML. In this tutorial, you will learn a quick function to replace them.
In C#, there are particulars symbols and function represent these line breaks. You can easily copy below function that will accet a string value and will replace all line breaks found in the string.
public static string ReplaceNewLine(string str) { str = str.Replace("\\r\\n", ""); str = str.Replace(Environment.NewLine, ""); return str; }