Newline not showing correctly in textbox

Posted by TheGateKeeper on Stack Overflow See other posts from Stack Overflow or by TheGateKeeper
Published on 2012-04-01T22:35:46Z Indexed on 2012/04/01 23:29 UTC
Read the original article Hit count: 197

Filed under:
|
|
|

I am loading a string from my database which among other things contains line breaks (\r\n). However, this isn't being rendered as a new line but instead as \r\n.

If I type it directly in instead of loading it from a string, it works just fine but I need to be able to load it from a string.

Any ideas?

Edit: Upon closer inspection, it looks like the string is being returned as:

Changed test7\\r\\nChanged test8\\r\\nChanged test9Changed test7

From the database.

I tried running a .Replace(@"\\", @"\") on it but this had no effect at all. Any ideas?

© Stack Overflow or respective owner

Related posts about c#

Related posts about winforms