调用StringUtils工具类的strip()方法去掉中括号"[ ]":
或者自己写工具类
public static void main(String[] args) {
String s = "[aasa, bbbbb]";
String s1 = s.replaceAll("(?:\\[|null|\\]| +)", "");
System.out.println(s1);
}
标签:Java,String,s1,List,中括号,去掉 From: https://www.cnblogs.com/mask-xiexie/p/16635996.html