String title = "\t 10月上旬\t 10月中旬\t 10月下旬";
String[] arrTitles = title.split("\t");1、字符数组转List:
//使用 Java8 的Stream
List list2 = Arrays.stream(arrTitles).collect(Collectors.toList());
//基本类型也可以实现转换(依赖boxed的装箱操作)
int [] arrIndex = { 1, 2, 3 };
List listIndex = Arrays.stream(arrIndex).boxed().collect(Collectors.toList());2、List转字符数组:
//List转String
String[] strs1 = titleList.toArray(new String[titleList.size()]);版权声明:本文为yyj108317原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。