title: Split the words using string tokenizer if it is followed by two or more space/whitespace in java?
body: <p>In my string, i want to tokenize string on the basis of two or more spaces.</p>
  
  <p>E.x. </p>
  
  <pre><code>String str = "I am  Chaitanya Gadam.      Split   this string."
  StringTokenizer tokenizer = new StringTokenizer(str);
  while (tokenizer.hasMoreTokens()) 
  {
      String token = tokenizer.nextToken();
      System.out.println("==Token== : "+token);
  }
  </code></pre>
  
  <p>I am getting out put as :</p>
  
  <pre><code>==Token== : [I]
  ==Token== : [am]
  ==Token== : [Chaitanya]
  ==Token== : [Gadam.]
  ==Token== : [split]
  ==Token== : [this]
  ==Token== : [string.]
  </code></pre>
  
  <p>But desired Output should be :</p>
  
  <pre><code>==Token== : [I am]
  ==Token== : [Chaitanya Gadam.]
  ==Token== : [split]
  ==Token== : [this string.]
  </code></pre>