java get an int from a char

Java
char charValue = '2';
int intValue = Character.getNumericValue(charValue); // 2
Source

Also in Java: