I have an input mismatch error.
used regular expression ("//s*,//s*",",") but it doesn't work.
You should use \\
instead of //
String input = "a , b , c , d";
String output = input.replaceAll("\\s*,\\s*", ",");
System.out.println(output); // output: "a,b,c,d"