Reputation: 1
I'm trying to extract file name in a text file. Currently, i'm using tokenizer. Somehow, not all of the file names is extracted correctly.
This is my code:
list = sc.nextLine();
token = new StringTokenizer(list,".txt");
newlist = token.nextToken();
This is what happen: The token only extract "Kesiha" insted of "Kesihatan"
Solutions?
Upvotes: 0
Views: 428
Reputation: 126
From the doc for StringTokenizer
"All characters in the delim argument are the delimiters for separating tokens."
So Its splitting on the "t"
Upvotes: 1