Search code examples
javaresourcebundle

How do you represent the pipe symbol in the resource bundle


How do you represent the "pipe" symbol in the resource bundle

e.g. What is |6|? The pipe symbol is not getting translated properly for me


Solution

  • As others have pointed out, the | is like any other character. A pipe will produce a pipe.

    Maybe you're asking about passing a variable using MessageFormat? In which case, you would want something like "What is {6}?" using "{" and "}" as opposed to the "|" character.