When I run parseInt:
Integer.parseInt(myString);
it throws:
NumberFormatException: For input string: \"\"
If the string can be empty I do it this way:
Integer.parseInt("0" + inputString)
When I'm not sure it contains only digits:
Integer.parseInt(0 + inputString.replaceAll("\\D+",""))