将逗号分隔的字符串转换为List
List
List
将list转化为逗号分割的字符串
String str = String.join(",", list);
String str = StringUtils.json(list.toArray(), ",");
将字符串中的字符替换
String newStr = str.replace("需替换的字符", "目标字符");
2023-11-11 11:46:58
将逗号分隔的字符串转换为List
List
List
将list转化为逗号分割的字符串
String str = String.join(",", list);
String str = StringUtils.json(list.toArray(), ",");
将字符串中的字符替换
String newStr = str.replace("需替换的字符", "目标字符");
下一篇:Java基础 ArrayList