PropertiesConfiguration getStringArray

楔子

学习笔记。
遇到使用了 commons-configuration,好奇getStringArray的分隔符是什么,查找官网发现一个例子,记录一下,以备后续翻看。

getStringArray 分隔符

<dependency>
    <groupId>commons-configurationgroupId>
    <artifactId>commons-configurationartifactId>
    <version>1.9version>
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));
}

官方例子以逗号作为分隔符
PropertiesConfiguration getStringArray_第1张图片

你可能感兴趣的:(java)