String str ="This is String {} split() by StringTokenizer, created by mkyong";
StringTokenizer st = new StringTokenizer(str,"\t\n,;{}[]().-<>&^%$@!-+/*~=");
I use above code to tokenize.it works fine but not work for spaces
String str ="This is String {} split() by StringTokenizer, created by mkyong";
StringTokenizer st = new StringTokenizer(str,"\t\n,;{}[]().-<>&^%$@!-+/*~=");
I use above code to tokenize.it works fine but not work for spaces
I tried. Add " " at the end. It then seperates by space too.
StringTokenizer st = new StringTokenizer(str,"\t\n,;{}[]().-<>&^%$@!-+/*~= ");