瓜娃之字符串分割,连接

Splitter.on(',')

.trimResults()

.omitEmptyStrings()

        .split(" foo, ,bar,");



用逗号分割,去掉结果两边的空格,忽略空字符串。


private static final Joiner JOINER = Joiner.on(", ").skipNulls();

private static final Joiner JOINER =Joiner.on(", ").useForNull(String);


JOINER.join("ffffffff","ddddd",null);



你可能感兴趣的:(瓜娃之字符串分割,连接)