Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

String..

 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
could anyone let me know how to check whether the string is an integer?
Thanks,
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Integer.parseInt(String)
If the String doesn't represent an integer, the method will throw a NumberFormatException. Otherwise, it returns the value of the int. Similar methods exist in the other numeric wrapper classes as well - Float, Double, Long, etc.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic