[英]How to escape curly braces in my properties file which is fetched using the ResourceBundle API
In properties file I am having a key=A: {{0}, {1}}, B: {{2}, {3}}
. 在属性文件中,我有一个key=A: {{0}, {1}}, B: {{2}, {3}}
。 I am expecting a string "A: {0, 1}, B: {1, 2}"
. 我期待一个字符串"A: {0, 1}, B: {1, 2}"
。 The numbers inside the curly braces are parsing. 花括号内的数字正在解析。 How can I include the character '{' without binding to any value? 如何包含字符“{”而不绑定任何值? I also tried by escaping the character like this "//{". 我也试过逃避这个角色“// {”。 Even I couldn't get the expected result. 即使我无法得到预期的结果。 An error java.lang.IllegalArgumentException: can't parse argument number 0, 1 \\ occurs. 错误java.lang.IllegalArgumentException:无法解析参数编号0,1发生。
key=A: '{'{0}, {1}'}', B: '{'{2}, {3}'}'
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.