public static void main(String[] args)
{
    String testStr = "This is a test,      this is only a test.";
    String[] words = split(testStr);

    System.out.println(testStr);
    System.out.println("Word count: " + words.length);
    for(int i=0; i<words.length; i++)
    {
        System.out.println("word: " + words[i]);
        System.out.println("length: " + words[i].length());
        System.out.println();
    }
}