String分割成int[]和List<Integer>


int[]
int[] ids= StringUtil.isEmpty(classIds)?null:Arrays.stream(classIds.split(",")).mapToInt(Integer::parseInt).toArray();
 
List<Integer>
List<Integer> collect = StringUtil.isEmpty(classIds)?null:Arrays.stream(classIds.split(",")).mapToInt(Integer::parseInt).boxed().collect(Collectors.toList());


 
原文地址:https://www.cnblogs.com/todarcy/p/15651365.html