Results 1 to 6 of 6
Thread: Converting string to integer
- 05-18-2012, 05:42 AM #1
Member
- Join Date
- May 2012
- Posts
- 2
- Rep Power
- 0
- 05-18-2012, 05:52 AM #2
Moderator
- Join Date
- Jul 2010
- Location
- California
- Posts
- 1,606
- Rep Power
- 5
Re: Converting string to integer
See the API for the Integer class, in particular the parseInt method
- 05-18-2012, 06:09 AM #3
Member
- Join Date
- May 2012
- Posts
- 2
- Rep Power
- 0
Re: Converting string to integer
Im still not sure what to do and am a little confused. Can you please elaborate?
- 05-18-2012, 06:22 AM #4
Re: Converting string to integer
See the API for the Integer class, in particular the parseInt method
dbWhy do they call it rush hour when nothing moves? - Robin Williams
- 05-18-2012, 09:29 AM #5
Moderator
- Join Date
- Apr 2009
- Posts
- 10,460
- Rep Power
- 16
Re: Converting string to integer
If the user is typing this in (on a single line):
W=123,H=1234,L=12345
you will also need to split the String based on the commas.
You'll need to look at the other String methods to then find the integer part of (eg)
W=123
Then you can use the links given above to turn that into an int.Please do not ask for code as refusal often offends.
- 05-18-2012, 11:10 AM #6
Similar Threads
-
Exception while converting string to integer
By bharatgs7 in forum New To JavaReplies: 3Last Post: 01-11-2012, 05:06 AM -
Converting J001 to integer
By jaylimix in forum New To JavaReplies: 4Last Post: 12-15-2011, 11:08 PM -
converting a given positive integer m to a positional number system in base n
By Renxx in forum New To JavaReplies: 2Last Post: 11-27-2011, 05:11 PM -
Converting a 2's complement to the proper integer
By Chuklol in forum New To JavaReplies: 1Last Post: 10-10-2011, 05:47 AM -
Converting an integer into a BigInteger
By mzjazzygirl in forum New To JavaReplies: 27Last Post: 09-23-2010, 06:37 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks