initial code to convert digit string to digit integer without using Integer.parseInt(String) method