Java examples for java.lang:Math Value
Converts char digit into integer value.
import java.math.BigInteger; public class Main{ /**// w ww.java2 s .c om * Converts char digit into integer value. Accepts numeric chars (0 - 9) as * well as letter (A-z). */ public static int parseDigit(char digit) { if ((digit >= '0') && (digit <= '9')) { return digit - '0'; } if (CharUtil.isLowercaseLetter(digit)) { return 10 + digit - 'a'; } return 10 + digit - 'A'; } }