Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Convert \r\ to next line
Message
 
 
To
All
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Title:
Convert \r\ to next line
Miscellaneous
Thread ID:
01667314
Message ID:
01667314
Views:
46
Hi,

I need to insert into the body of an email message an entry in a multi-line text box.
For example, user may enter:
This is line 1
This is line 2
This is line 3
In the debugger (within ASP.NET) the string looks like this
This is line 1\r\This is line 2\r\This is line 3
The email is sent in HTML format. So the entire line (above) shows in the email body as one line.
How do I convert this line so that in the email it would show just as user types it (as three lines)?

TIA

UPDATE: Found solution:
cText = cText.Replace(Environment.NewLine, "<br/>");
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Reply
Map
View

Click here to load this message in the networking platform