List list = new ArrayList();
list.add("qq");
list.add("aa");
String collect = (String) list.stream().map(code -> "'"+String.valueOf(code)+"'").collect(Collectors.joining(","));
System.out.println(collect);
输出:
'qq','aa'
Java List转字符串 逗号隔开 且带单引号字符串
最新推荐文章于 2024-08-29 11:51:21 发布