本文共 379 字,大约阅读时间需要 1 分钟。
Listlist = new ArrayList<>(); list.add("小米"); list.add("华为"); list.add("三星"); String List2String = StringUtils.join(list.toArray(), ","); System.out.println("这是列表转换为字符串用逗号分隔: " + List2String); List String2List = Arrays.asList(List2String.split(",")); System.out.println("这是字符串转换为列表,用逗号分隔: " + String2List);
转载地址:http://zuowi.baihongyu.com/