Do resource bundles in Java support runtime string substitution?

前端 未结 8 751
夕颜
夕颜 2020-12-25 10:32

Can you do the following with a Java ResourceBundle?

In the properties file...

example.dynamicresource=You currently have {0} accounts.
8条回答
  •  失恋的感觉
    2020-12-25 11:14

    Remember that when using MessageFormat.format() you need to use a double quote ('') in your resource bundle if you want to express single quote (').

提交回复
热议问题