js查找元素、js查找字符串
let index=data.indexOf(",");
js截取、js截取字符串
$("#bankurl_id").val(data.substring(0,index));
$("#bankname").val(data.substring(index+1));
js字符串转数组
let a = typeId.split('#');
java字符串转数组,数组转集合
String[] split = dates.split(","); List<String> list2 = Arrays.asList(split);
数组json字符串转集合
ArrayList<String> json = gson.fromJson(s, ArrayList.class);
集合转数组
List<String> a = new ArrayList<>(); a.add("a"); a.add("b"); a.add("c"); String[] st = a.toArray(new String[]{}); Arrays.stream(st).filter(s -> s.length()>0).forEach(System.out::println);
//从list集合中,取出字段name的列表 List<String> names = list.stream().map(p -> p.getName()).collect(Collectors.toList());