替换符号为,
public static void main (String[] args) { String pattern = "\\s\\|\\s\\|\\s"; String str=" 32222 | | 3333| | ";
String res = str.replaceAll(pattern, ",");
System.out.println(res);}
替换符号为,
public static void main (String[] args) { String pattern = "\\s\\|\\s\\|\\s"; String str=" 32222 | | 3333| | ";
String res = str.replaceAll(pattern, ",");
System.out.println(res);}