Hi, I've got a project in which I need the program to reject a sentence if it has a certain word in it using StringTokenizer. Here is what I have so far
Hint: You are looking for substrings within a string.
I haven't once seen anyone use a substring for this lesson. They've used do-while loops but I can't seem to figure one out. I can't really get a hold of this StringTokenizer class. It's a bit confusing. I understand the concepts but putting it to use is much harder. I think that it doesn't work because of the "Enter next sentence:" has only 4 tokens that are counted when stk.countTokens() is called because it'll work if it's at spot 0,1,2,or 3 but after that...nothing.
Hi, I've got a project in which I need the program to reject a sentence if it has a certain word in it using StringTokenizer. Here is what I have so far
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.