Für deinen speziellen Fall würde ich es wie in C machen:
Code:
String strValue = "123";
int iTest = strValue.charAt(2) - '0';
Sonst gibt es auch die statische Methode Integer.parseInt().
Code:
try
{
iTest = Integer.parseInt(strValue);
}
catch (Exception e)
{
iTest = -4711;
}