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.
Why are you using compareTo() in the first place? There are lots of methods in the Character class which allow you to tell whether a char is a letter, a number, etc., etc. I think one of those methods would provide a more elegant solution to your problem.
Joined: Mar 16, 2011
thank for helping. i know how to do this.
i think i will use string.charAt(0) to compare