I have this string: 3,999
I need to extract all the characters before the comma, and turn them into a number, and the same for all the characters behind the comma. The amount in front of the comma and behind can vary.
notice small case then big case...this is generic java functions...
indexOf -> finds the position of a character and returns back an integer.
subString -> breaks the string into smaller strings (for example test = abcdef
test.subString(0,2) will return back the first 3 characters...i think it's starts at 0, i might be wrong, haven't look at the reference on for awhile, this is all coming out of my head. If you just put 1 argument it will return the first position and all the rest of it along the way.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.