String path="123,456,789"
if(path!=null && path.indexOf(",")!=-1){
String[] array=path.split(",");
List<String> list=Arrays.asList(array);
}
/**
* 逗号分割字符串转为List
* */
public static <T> List idsStrToList(String idsStr) {
return Arrays.asList(idsStr.split(","));
}
/**
* 任意字符分割字符串转为List
* */
public static <T> List idsStrToListSeparator(String idsStr, String separator) {
return Arrays.asList(idsStr.split(separator));
}
标签:String,Arrays,list,List,逗号,split,拆分,idsStr,path From: https://www.cnblogs.com/over-sk/p/17160615.html