Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Convert \r\ to next line
Message
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Titre:
Convert \r\ to next line
Divers
Thread ID:
01667314
Message ID:
01667314
Vues:
47
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
Répondre
Fil
Voir

Click here to load this message in the networking platform