Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.util.Arrays;

public class Main {
    public static void main(String[] argv) throws Exception {
        String testStr = "One, Two, and Three.";
        System.out.println("Original string: " + testStr);
        String[] result = testStr.split("\\W+");
        System.out.print("Split at word boundaries: ");
        System.out.println(Arrays.toString(result));

    }
}
/*
Original string: One, Two, and Three.
Split at word boundaries: [One, Two, and, Three]
*/