I need to replace all new line characters in a string with a valid
XHTML line break tag <br />.
I'm trying to use the string.Replace method for this. Here's some
example code:
String description = "This is a video description \n Hello World";
description = description.Rep lace("\n", "<br />");
Literal1.Text = description;
When run the Literal controls rendered HTML is:
This is a video description <brHello World
I'm expecting it to be:
This is a video description <br /Hello World
Many thanks
Alun
XHTML line break tag <br />.
I'm trying to use the string.Replace method for this. Here's some
example code:
String description = "This is a video description \n Hello World";
description = description.Rep lace("\n", "<br />");
Literal1.Text = description;
When run the Literal controls rendered HTML is:
This is a video description <brHello World
I'm expecting it to be:
This is a video description <br /Hello World
Many thanks
Alun
Comment