字符串轉數組
字符串轉數組
// 前臺傳到后臺的數據
// 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.

浙公網安備 33010602011771號