Results 1 to 2 of 2
- 12-15-2011, 01:25 PM #1Member
- Join Date
- Dec 2011
- Rep Power
String managing - retrieving a number from inputted string
Grettings, this my first post here, I joined up to ask a little question that I just can't seem to figure out on my own. Perhaps some hints would light me the way.
I'm kinda of a newbie in java. I know a bit of C and the basics of Java.
anyway here's my question.
I'm creating a program where I expect users to input math formulas such as (x,y,z)=(x0,y0,z0)+k(a,b,c)
There are 3 formulas of input and I want the user to be able to choose between the three.
As an example, I will ask which formula does the user want to input and I will choose one. Then he has to input with the defined format like the above mentioned but replacing x0,y0,z0 and a,b,c with numbers.
Is there any function or such where I can "fetch" the numbers in the middle of the string and use them as floats or int's?
- 12-15-2011, 01:39 PM #2
Re: String managing - retrieving a number from inputted string"fetch" the numbers in the middle of the string and use them as floats or int's
Look at the Integer and Double class for methods to convert/parse Strings into ints or doubles
- By micolord in forum New To JavaReplies: 12Last Post: 09-11-2011, 02:23 PM
- By micolord in forum EclipseReplies: 1Last Post: 09-07-2011, 03:45 PM
- By Karenthian in forum New To JavaReplies: 5Last Post: 04-03-2011, 03:12 AM
- By computerbum in forum New To JavaReplies: 1Last Post: 04-27-2010, 06:06 PM
- By wizard_oz in forum New To JavaReplies: 9Last Post: 11-16-2009, 08:04 PM