parseIntじゃだめですかい?
String input = "12345"

try
{
int i = Integer.parseInt(input);
} catch (Exception e) {

}