Question:
Is there a command Float.parseNumbers(s
) that returns a float?
Answer:
Sure, parseInt
(s) is simply:
Integer temp = Integer.valueOf(s); int x = temp.intValue();which has an equivalent for floats
Float temp = Float.valueOf(s); float x = temp.floatValue();which can be written as a single line
float x = Float.valueOf(s).floatValue();