字符串转数组

字符串转数组

// 前台传到后台的数据
// ids: id001,id002,id003

String[] ids = new String[]{};
// 分割字符串
ids = request.getParameter("ids").split(",");
List  idsList = Arrays.asList(ids);

数组转List


1.8api :

Modifier and Type Method
String[] split(String regex)
String[] split(String regex, int limit)

Splits this string around matches of the given regular expression.

posted @ 2018-03-06 22:08  小鸣Cycling  阅读(2057)  评论(0编辑  收藏  举报