Escape Sequenze in Resource File

Hi!

I've the following problem. I've created a multilingual application and put all the strings in a resource file for each language. This all works fine so far.

The problem is if there are any escape sequences in the strings like "\n". If I show this string in a MessageBox "\n" is not replaced with a NewLine.

How is the best practice to accomplish this

greets,
Markus


Answer this question

Escape Sequenze in Resource File

  • WIPIT

    The problem is that you are using the string after compilation - this means that the c# compiler never gets the chance to swap "\n" for a new line.

    Could you split the string into two parts and add them seperately

    e.g. MessageBox.Show(resourceManager.getString("part1") + "\n" + resourceManager.getString("part2"));

    Not tidy, I agree.

  • Escape Sequenze in Resource File