Search code examples
c#stringescapingresource-files

How to use escape sequences in strings contained in resource files


I have a string that I get from my resources a .resx file

in my resx file I have my key and my string which is:

Hello\r\n We're just you setting up

now when I pull this string out and bind it to a label in my view I see that exact string where as if I simply set the string to equal that (bypassing the resource file) I get the expected new line behavior

I was wondering if there is a way to keep the behavior of the escape sequence when getting the string from my resource file?


Solution

  • By using char(13) + char(10) in them. In the resources window, you can do this with Shift+Enter.