代码展示
@Test
public void test23(){
Set<String> set = new HashSet<>();
("aaaa");
("qqqq");
("wwww");
("eeee");
List<String> list = new ArrayList<>(set);
// 将集合转换成以逗号分隔的字符串
String str = (",", list);
(str);
// 将字符串转换成集合
List<String> asList = ((","));
(str1 -> (str1));
}
结果展示
qqqq,wwww,aaaa,eeee
qqqq
wwww
aaaa
eeee
Process finished with exit code 0