This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
You could do something with regular expressions (the java.util.regex package):
You can learn more about how regular expressions work from the Java Tutorial. They're very powerful, but contain some complexities that may require a bit of practice. [ May 17, 2006: Message edited by: Jim Yingst ]