• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Change a String to an int

 
matt prowell
Greenhorn
Posts: 18
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to take a String and make it an int. Thanks for any help!
 
luc comeau
Ranch Hand
Posts: 97
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey
This is probably a dirty way to do it, but yah...it works


Pretty sure that works, dunno how efficient or what not it is....
good luck
 
luc comeau
Ranch Hand
Posts: 97
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
im a retard its suposed to be ----theInt=Integer.parseInt(theString);----
my bad
 
Lionel Badiou
Ranch Hand
Posts: 140
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Matt,

Look at the java.lang.Number.Integer.parseInt(String) method.

Hope that helps,
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not about GUI stuff, moving to Java in General (Intermediate)
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic