(String regex)
| 10 | "you must cut down the mightiest tree in the " + |
| 11 | "forest...with... a herring!"; |
| 12 | public static void split(String regex) { |
| 13 | System.out.println( |
| 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 |