字符串和数组互转
public static void main(String[] args) { List<String> list= new ArrayList(); list.add("one"); list.add("two"); list.add("three"); list.add("four"); /** * 用->字符串将list内容连接 * 结果:one->two->three->four,不用做二次处理 */ System.out.println(list); String value=list.join(","); System.out.println(value); //字符串转数组 List<String> receivers = value.split(';') System.out.println(receivers); }