Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.util.regex.Pattern;

public class Main {
    public static void main(String args[]) {

        Pattern p = Pattern.compile(" ");
        String tmp = "this is a test";

        String[] tokens = p.split(tmp);

        for (int i = 0; i < tokens.length; i++) {
            System.out.println(tokens[i]);
        }

    }
}