1.用java1.8中的stream:
List<String> list = new ArrayList<>();
list.add("110");
list.add("120");
String ids = list.stream().map(s -> "\'" + s + "\'").collect(Collectors.joining(", "));
System.out.println(ids);
输出结果:'110','120'
1.用java1.8中的stream:
List<String> list = new ArrayList<>();
list.add("110");
list.add("120");
String ids = list.stream().map(s -> "\'" + s + "\'").collect(Collectors.joining(", "));
System.out.println(ids);
输出结果:'110','120'