Re: Stupid parsing question
To convert a string to an int use Integer.parseInt(..)
Of course you have to extract the string representation of the number from the string first. You can use a regex to do that.
Re: Stupid parsing question
Yeah, thats the part that I don't know how to do, the regex part ;)
Re: Stupid parsing question
hmmm...
Strting text = "The action you going to take costs 5 dollars, and will take up to 3 days to complete";
String[] strin;
String delimiter = " ";
strin = text.split(delimiter)
int number = Integer.parseInt( strin[strin.length-4] );
This should work, assuming the number is always the 4th element from the rear side of the string.
Probably with some modification this would also work
http://www.java2s.com/Code/Java/Regu...xpressions.htm