This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes IsUpper for non letters Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » Beginning Java
Bookmark "IsUpper for non letters" Watch "IsUpper for non letters" New topic

IsUpper for non letters

Anthony Smith
Ranch Hand

Joined: Sep 10, 2001
Posts: 285
How does isUpper work for non-letters? I am getting weird stuff
Dave Vick
Ranch Hand

Joined: May 10, 2001
Posts: 3244
isUpper checks to see if it falls into a speciic range in the unicode set of characters. To avoid your strange results you could always test it before you check to see if it upper case. Use isDigit or isLetter to see what it is then test it accordingly.

Sun Certified Programmer for the Java� 2 Platform

I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: IsUpper for non letters
It's not a secret anymore!