Code in c#:
Mailcontent= constant.mail+constant.mail;
Explanation:
First constant contain selected for 1st round
Second constant contain selected
how to add new line in code
Output:
Selected for 1st round
Selected
Code in c#:
Mailcontent= constant.mail+constant.mail;
Explanation:
First constant contain selected for 1st round
Second constant contain selected
how to add new line in code
Output:
Selected for 1st round
Selected
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Anandu G NathPosted Dec 27, 2023, 8:40 AM
Tuhin PaulPosted Apr 23, 2023, 2:25 AM
To add a new line between the two constants, you can use the `Environment.NewLine` property in C#. See below:
Here `Environment.NewLine` is added between the two constants to create a new line in the `Mailcontent` string. This will produce the following output:
Each constant will appear on a new line.
Brahma Prakash ShuklaPosted Apr 21, 2023, 6:35 AM
To add a new line in the
Mailcontentstring in C#, you can use the newline character"\n"orEnvironment.NewLineconstant. Here's an example of how to modify your code to add a new line:makefileCopy code
Mailcontent = constant.mail + Environment.NewLine + constant.mail;or
makefileCopy code
Mailcontent = constant.mail + "\n" + constant.mail;In this modified code, we are adding a new line between the two
constant.mailstrings using theEnvironment.NewLineconstant or the"\n"character.This will result in the
Mailcontentstring having a new line between the two constants when displayed or sent as an email.Sachin SinghPosted Apr 4, 2023, 9:06 AM
you need to do 2 things
1.
2.
Uday DodiyaPosted Apr 4, 2023, 5:15 AM
Hello,
If you're sending an HTML email, you can use an HTML line break tag
to add a new lineIf you're sending a plain text email, you can use the
"\r\n"sequence to add a new line.Jignesh KumarPosted Apr 4, 2023, 4:41 AM
Hello Meghana,
As Amit suggested you can use Environmnet.NewLine or you can use
for new line,
Amit MohantyPosted Apr 4, 2023, 4:13 AM
You can use
Environment.NewLine