I'm getting some text from a database, so I want to view them in a TextBox object. The text in the DB has \n character开发者_运维知识库 to represent a new line, but when I bind the text to the TextBox, the \n still appear without being transformed to new lines!
I've tried the "\r\n" instead with no results!
What's wrong!
If you look at the string in the debugger, I'm willing to bet that it has an \\n
in it, not an \n
. \\n
will be displayed as \n, but \n
will be displayed as a newline
string s = "Hello\\nWorld"; // Displays 'Hello\nWorld'
s = "Hello\nWorld"; // Displays 'Hello
// World'
精彩评论