MCPcopy Index your code
hub / github.com/BruceEckel/OnJava8-Examples / main

Method main

strings/SplitDemo.java:9–17  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

7
8public class SplitDemo {
9 public static void main(String[] args) {
10 String input =
11 "This!!unusual use!!of exclamation!!points";
12 System.out.println(Arrays.toString(
13 Pattern.compile("!!").split(input)));
14 // Only do the first three:
15 System.out.println(Arrays.toString(
16 Pattern.compile("!!").split(input, 3)));
17 }
18}
19/* Output:
20[This, unusual use, of exclamation, points]

Callers

nothing calls this directly

Calls 2

splitMethod · 0.80
toStringMethod · 0.45

Tested by

no test coverage detected