protected void Page_Load(object sender, EventArgs e)
{
string str = "Hello \r\n world";
Response.Write(str);
Response.Write("<br/>\n");
str = str.Replace(Environment.NewLine, string.Empty);
Response.Write(str);
}
{
string str = "Hello \r\n world";
Response.Write(str);
Response.Write("<br/>\n");
str = str.Replace(Environment.NewLine, string.Empty);
Response.Write(str);
}
Then preview in browser and view html source.
* Environtment.NewLine is equal to \r\n
No comments:
Post a Comment