Java ResourceBundle leading whitespace in values

前端 未结 2 1736
误落风尘
误落风尘 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.

提交回复
热议问题