Posted By

juzerali on 12/22/09


Tagged

SplitRegexdelimiterjava


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

juzerali


using the 'split' method in java using 2 or more spaces as a delimiter


 / Published in: Java
 

  1. String str="This is my Red house";
  2. String[] result=str.split(" +");
  3.  
  4. for (int i=0;i<result.length;i++)
  5. {
  6. System.out.println("The result is ==== "+result[i]);
  7.  
  8. }

Report this snippet  

You need to login to post a comment.