I've a csv string like
"abc, java, stackoverflow , stack exchange , test"
Can I use regex to remove the space around the commas to get a string like
"abc,java,stackoverflow,stack exchange,test"
str = str.replaceAll("\\s*,\\s*", ",");
\s (which has to be written as \\s in a Java string literal) matches one whitespace character. * matches zero or more of the "thing" before it. So, \s* means zero or more whitespace characters. You can figure out the rest. ;-)replace() is not working. Now I see from the docs, that replaceAll() supports regex. Thanks!replace().
a , "b , b" , c?