(String[] args)
| 14 | Arrays.toString(knights.split(regex))); |
| 15 | } |
| 16 | public static void main(String[] args) { |
| 17 | split(" "); // Doesn't have to contain regex chars |
| 18 | split("\\W+"); // Non-word characters |
| 19 | split("n\\W+"); // 'n' followed by non-words |
| 20 | } |
| 21 | } |
| 22 | /* Output: |
| 23 | [Then,, when, you, have, found, the, shrubbery,, you, |