Hello,
I read an entire text file at once. I put in a table all the words of the text.
So I'm taking a tokenizer as a separate space. Unfortunately, when there is a newline, it works more. For it is not a space and yet it should be treated as such. Here is my code:
Code:
StringTokenizer stok;
stok = new StringTokenizer(chain); / / Apply the StringTokenizer chain
while(stok.hasMoreTokens()){ / / Returns false when reading the lastok word
nMots = stok.countTokens(); / / Indicates the number of words remaining in stok
s = stok.nextToken(); / / Read a stokring in the next word
}
I think I am facing a problem in StringTokenizer. Any help is appreciated. Thanks in advance.
Bookmarks