Java ResourceBundle leading whitespace in values

前端 未结 2 1737
误落风尘
误落风尘 2021-01-03 18:55

I\'m trying out the example given at Oracle\'s documentations. The java file is here as shown in that page. Now with this java file, I keep a LabelsBundle.properties

相关标签:
2条回答
  • 2021-01-03 19:26

    A Unicode escape sequence \u0020 should do it, because the properties parser should recognise it as an actual value and the Java String should interpret \u0020 as the Unicode code point for space.

    Alternatively, IIRC, you can escape the space with a backslash like this \ my value. Works for keys, too.

    0 讨论(0)
  • 2021-01-03 19:27

    You can escape space with backlash:

    s1 =\ computer
    
    0 讨论(0)
提交回复
热议问题