apache commons配置加载属性,直到“,”字符


问题内容

我想从属性文件加载配置(Apache Commons配置)。我的程序是:

PropertiesConfiguration pc = new PropertiesConfiguration("my.properties");
System.out.println(pc.getString("myValue"));

my.properties我有

 myValue=value,

用逗号

当我运行程序时,输出value不是value, with comma。看起来值一直加载到,字符为止。

有任何想法吗?


问题答案:

检查Javadoc。您必须设置setDelimiterParsingDisabled(true)才能禁用属性分析列表。