String字符串转List
javascript
String str = "苹果, 橘子, 梨";
List<String> asList = Arrays.asList(str.split(","));
for (String str1: asList) {
System.out.println(str1);
}
运行结果:
javascript
苹果
橘子
梨