Function std::char::to_digit

pub fn to_digit(c: char, radix: uint) -> Option<uint>

Convert a char to the corresponding digit.

Return value

If c is between '0' and '9', the corresponding value between 0 and 9. If c is 'a' or 'A', 10. If c is 'b' or 'B', 11, etc. Returns none if the char does not refer to a digit in the given radix.

Failure

Fails if given a radix outside the range [0..36].