Tell me more about what this program is supposed to do: Are you going to give it other phrases to remove from other strings, or will you always be removing the words "on the moon" from all input or what?
When you specify your delimiter as "on the moon" you are telling StringTokenizer that you want to use all of the seperate letters in that sentance as delimiters not the actual String itself. You are better off using the split command or something equivalent.
Hope this helps!
Joined: Sep 10, 2004
thank you Elouise for your prompt replt.
Basically, it suppose to remove only once the 3 word "on the moon" so the end result will be: