Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.util.Scanner;
import java.util.regex.Pattern;

public class Main {
    private static final Pattern WHITESPACE_PATTERN = Pattern.compile("\\s+");

    private static Scanner wordScanner(String text) {
        Scanner s = new Scanner(text);
        s.useDelimiter(WHITESPACE_PATTERN);
        return s;
    }
}