1,String转List
//常见的为逗号分隔 String str = "a,b,c"; List<String> list1 = Arrays.asList(str.split(",")); //[a, b, c] List<String> list2 = Arrays.asList(str.split("")); //[a, ,, b, ,, c]
2,List转String
List<String> list = new ArrayList<String>(); list.add("a"); list.add("b"); list.add("c"); String str1 = StringUtils.join(list, ","); //a,b,c String str2 = StringUtils.join(list, ""); //abc