Help!! I've been out this program for awhile and can not get it to not count tab.
For example, if I imput 'k k k', with tabs between each k, it will count it as a one 3 letter
word, instead of three 1 letter words. Space works correctly, but tab does not. I know tab is one of the default delimiters, but it's not working. I'm at a loss.
tokenizer = new StringTokenizer(lineOfText);
while (tokenizer.hasMoreTokens())
{
currentWord = tokenizer.nextToken();
characterCount = currentWord.length();
// Increment the counter corresponding to the length of this word.
switch (characterCount)
{
case 1 :
length1Count++;
break;
case 2 :
length2Count++;
break;
case 3 :
length3Count++;
break;
case 4 :
length4Count++;
break;
case 5 :
length5Count++;
break;
case 6 :
length6Count++;
break;
case 7 :
length7Count++;
break;
case 8 :
length8Count++;
break;
case 9 :
length9Count++;
break;
default:
length10Count++;
}