How exactly does String.split() method in Java work when regex is provided?
It splits on every “\\S” which in regex engine represents \S non-whitespace character. So lets try to split “x x” on non-whitespace (\S). Since this regex can be matched by one character lets iterate over them to mark places of split (we will use pipe | for that). is ‘x’ non-whitespace? YES, so lets mark … Read more