I want to assign the TextBlock's Text in my code behind and display it on the screen. It might contain new line character also. But somehow the TextBlock is not printing that character. I have used the following combinations in my text to print the new line character


 \n\r\n
Has anyone done this? can you help me?
In
XAMLyou can do like thisIn code you can do like this
Both are working for me.
Edited
For your scenario you can do this
or in your case
Replace “\n” string with new line character.
P.S. It will create problem where you actually want to show
\nstring instead of new line character.