What does regular expression \\s*,\\s* do?

That regex "\\s*,\\s*" means:

  • \s* any number of whitespace characters
  • a comma
  • \s* any number of whitespace characters

which will split on commas and consume any spaces either side

Leave a Comment