楔子
学习笔记。
遇到使用了commons-configuration
,好奇getStringArray
的分隔符是什么,查找官网发现一个例子,记录一下,以备后续翻看。
getStringArray 分隔符
<dependency>
<groupId>commons-configuration</groupId>
<artifactId>commons-configuration</artifactId>
<version>1.9</version>
</dependency>
public void getconfig() throws ConfigurationException {
PropertiesConfiguration config = new PropertiesConfiguration("generator.properties");
//以逗号作为分隔|http://commons.apache.org/proper/commons-configuration/userguide/howto_properties.html#Properties_files
String[] tablePrefixes = config.getStringArray("tablePrefix");
System.out.println(Arrays.toString(tablePrefixes));
}
官方例子以逗号作为分隔符