[Solved] Extracting a char from a string


You can’t parse a String which represents a Double with Integer.parseInt().

This will not work:

Integer.parseInt("3.0");

This will work:

Integer.parseInt("3");

Use this instead:

new Double("3.0").intValue()

But consider following behavior:

new Double("2.5").intValue() will return 2.

2

solved Extracting a char from a string