funny. come on, serious, this is a classic home work.
I can tell you that you should use this class:
java.lang.String - javadoc[
^]
This might also be helpfull -
StringTokenizer[
^]
Read. Think about it. That's 90% of developing software. The coding is just the translation of your wicked thoughts into the machine.