MainClass.java Source code

Java tutorial

Introduction

Here is the source code for MainClass.java

Source

import java.util.Arrays;
import java.util.regex.Pattern;

public class MainClass {
    public static void main(String[] args) {
        String input = "This!!unusual use!!of exclamation!!points";
        System.out.println(Arrays.asList(Pattern.compile("!!").split(input)));

        System.out.println(Arrays.asList(Pattern.compile("!!").split(input, 3)));
        System.out.println(Arrays.asList("Aha! String has a split() built in!".split(" ")));
    }
}
/**/