Reputation: 3
I am trying to format text that will be sent in an email to a user. Currently, I am simply printing to the console to make sure the formatting is correct. I used all the escape characters I found while doing my research such as /r/n
and /t
but it's not working. The escape characters just show up in the text. For example, if I were to put
string someStringVar = boo;
"Hello World! /r/n" + someStringVar + "/t Goodbye!", I would expect the text to look like:
Hello World!
boo -tab- Goodbye!
instead, it looks like this:
Hello World! /r/nboo/t Goodbye!
Why???? I'm sure it's some stupid mistake, but I am too frustrated to figure it out. Help!
Upvotes: 0
Views: 1354
Reputation: 4928
If you are testing emails, you might also want to look at Papercut and nDumbster, both of these are available on www.codeplex.com
Upvotes: 0
Reputation: 30117
instead of /t
try \t
you are using wrong slash
Same thing is wrong with rest of the escape sequences
Upvotes: 0
Reputation: 888047
You need to use backslashes:
"Hello World! \r\n" + someStringVar + "\t Goodbye!"
Upvotes: 5