This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Java in General and the fly likes Change a String to an int Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Change a String to an int" Watch "Change a String to an int" New topic

Change a String to an int

matt prowell

Joined: Jul 12, 2004
Posts: 18
I need to take a String and make it an int. Thanks for any help!
luc comeau
Ranch Hand

Joined: Jan 20, 2005
Posts: 97
This is probably a dirty way to do it, but works

Pretty sure that works, dunno how efficient or what not it is....
good luck

National Research Council<br />Internet Logic Department
luc comeau
Ranch Hand

Joined: Jan 20, 2005
Posts: 97
im a retard its suposed to be ----theInt=Integer.parseInt(theString);----
my bad
Lionel Badiou
Ranch Hand

Joined: Jan 06, 2005
Posts: 140
Hello Matt,

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

Hope that helps,

Lionel Badiou
CodeFutures Software
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15302

Not about GUI stuff, moving to Java in General (Intermediate)

GenRocket - Experts at Building Test Data
I agree. Here's the link:
subject: Change a String to an int
It's not a secret anymore!