I have a program that takes in a line of input, separates it into individual words, and then runs each of those words through a method that replaces illegal characters (like ! and @) with spaces, and then inserts each word into a BST. For example, if a line of input was:

Code:
one TWO three@four
What would get broken up would be:

Code:
one
TWO
three@four
And then when the words went through my modify method, it would look like:

Code:
one
two
three four
Notice however that "three four" is considered one word. What I need to do is break apart "three four" after the illegal characters are removed so that my word structure would now look like:

Code:
one
two
three
four
i.e. four nodes would be inserted, not three. Is there any way to do this?