In the resource file there is a string resource somestring with a value of the form "first line \ n second line" . There is a TextBlock to which these lines should be output, respectively, with a line break. But for some reason they are derived in the form in which they are written, i.e. "\ n" is simply printed and lines are not transferred. I tried to resource and bind in xaml through x: Uid , and in the code through ResourceLoader , the result is the same and not the one that is needed. How can I solve this problem?

  • Try \ r \ n instead of \ n - Sergey
  • 2
    Try instead of using the '\ n' character in the resource string to press Shift + Enter . - Vlad
  • Well, yes, with Shift + Enter it turned out, but somehow it is perverted :) - denny7794
  • @Vlad: Why not as an answer? - VladD
  • @ denny7794: Well, \ only the source code in C # has a special meaning, what to do? - VladD

1 answer 1

Instead of \n you need to use Shift + Enter . Text in resources is not formatted by escape sequences.