Get your CodeRanch badge!*
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 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Change a String to an int" Watch "Change a String to an int" New topic
Author

Change a String to an int

matt prowell
Greenhorn

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
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


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: 15292
    
    6

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


GenRocket - Experts at Building Test Data
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Change a String to an int
 
Similar Threads
Can I use the paramProperty from a hyperlink in a textfield in the called .jsp-page?
how many objects will be created.
how to subtract two strings
how to read speific lines in a text file
How to deserialize persistent object if class has changed