java笔记之字符串,字符串数组,List<String>的相互转换
1、字符串转换成字符串数组
String str = "a1.png,a2.png,a3.png";// 原始字符串 String[] arrayStr = str.split(",");// 字符串转字符数组
2、(1)字符串数组转换成List<String>:
String[] strs = getResources().getStringArray(R.array.class_post);
List<String> titleList= Arrays.asList(strs);
(2)List<String>转换成字符串数组:
titleList = Arrays.asList(strs); strs=titleList.toArray(new String[titleList.size()]);