View Single Post
 
Reply
Posted 2010-02-25, 06:48 PM in reply to Slyvr's post "Java programming help Plz"
No need to put them into an array - you can use str.charAt(0) and str.charAt(1) for the first and second letters.

It's a wee bit hacky but you could try checking if the first letter is uppercase by comparing it to itself in uppercase:

return (str.charAt(0).equals(str.charAt(0).toUppercase()) );

The same can be done for the second letter.

I think it will work. I don't have a copy of the API to hand, so I can't give you a better answer right now.
Old
Profile PM WWW Search
Lenny simplifies with no grasp of the basicsLenny simplifies with no grasp of the basicsLenny simplifies with no grasp of the basicsLenny simplifies with no grasp of the basicsLenny simplifies with no grasp of the basicsLenny simplifies with no grasp of the basics
 
 
Lenny