Replace line breaks with BR tags
Posted by WorldofCode on Apr 13th, 2008
2008
Apr 13
In Classic ASP we used to replace line breaks or vbCrLf tags in the following way.
strValue = Replace(strValue, vbCrLf, "<br>")
In ASP.NET it is a bit different. Now we have the Environment.NewLine command that will determine the coding environment you are running in either VB or C#. So you can replace the line break command wether it is vbCrLf or /n.
string strValue = strValue;
strValue.Text = strValue.Replace(Environment.NewLine, "<br/>");
View Similar Posts



