• Post Reply Bookmark Topic Watch Topic
  • New Topic

Character.isLetter() Question  RSS feed

 
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When I call the method Character.isLetter(), and the character is a decimal '.' what will the method return? In other words, does Java consider a decimal to be a letter, a digit, or neither?
 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what result did you get when you ran a test program?
 
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the time it took to post that question... :roll:
 
Greg Roberts
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I jumped the gun on that post. I just ran a test program and it seems like a decimal is considered neither a letter or digit. It printed false when I ran isLetter and isDigit on a character '.'
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Greg Roberts:
... It printed false when I ran isLetter and isDigit on a character '.'

 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!