How do you usually convert line breaks in a form textbox or input=text element to html line breaks?
Thanks
Edit: Is it always \r\n with all browsers?
How do you usually convert line breaks in a form textbox or input=text element to html line breaks?
Thanks
Edit: Is it always \r\n with all browsers?
Or in C#:
myString.Replace("\r\n", "<br />");
If you're worried about it being different on different platforms, you could also do:
myString.Replace("\r\n", "<br />");
myString.Replace("\n", "<br />");
myString.Replace("\r", "<br />");
Is it always \r\n with all browsers?
This is handled on the server, it has nothing to do with browser. However I would suggest using:
System.Environment.NewLine
Depending on the scenario this could also work:
MyString.Replace(Chr(10), "<br/>")