views:

88

answers:

2

I'm extending Exception to implement a setter on the Message property. And this works just fine. But somehow this:

CustomException.Message = "Test" + Environment.NewLine + "Test Again";

Becomes this:

"Test\r\nTest Again"


I've also tried this, with no luck:

CustomException.Message = @"Test

Test Again";


Any ideas?

+3  A: 

Environment.NewLine IS \r\n (at least on Windows, anyway...)

wefwfwefwe
+2  A: 

\r\n characters will be converted to new line when you display it by using message box or assign it to text box or whenever you use it in interface.

Wael Dalloul