2013-04-11 01:07:29 -07:00
|
|
|
String toTokenize = "Hello,How,Are,You,Today";
|
|
|
|
|
|
2015-02-20 00:35:01 -05:00
|
|
|
String words[] = toTokenize.split(",");//splits on one comma, multiple commas yield multiple splits
|
|
|
|
|
//toTokenize.split(",+") if you want to ignore empty fields
|
|
|
|
|
for(int i=0; i<words.length; i++) {
|
|
|
|
|
System.out.print(words[i] + ".");
|
2013-04-11 01:07:29 -07:00
|
|
|
}
|