Java:将List<string>转换为字符串
Array.join()
js>["Bill","Bob","Steve"].join(" and ")Bill and Bob and Steve
static public String join(List<String> list, String conjunction){ StringBuilder sb = new StringBuilder(); boolean first = true; for (String item : list) { if (first) first = false; else sb.append(conjunction); sb.append(item); } return sb.toString();}
BIG阳
繁星点点滴滴
相关分类