Java Digit From toDigit(char c)

Here you can find the source of toDigit(char c)

Description

to Digit

License

Open Source License

Declaration

private static int toDigit(char c) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    private static int toDigit(char c) {
        if (c >= '0' && c <= '9')
            return c - '0';
        if (c >= 'a' && c <= 'f')
            return c - 'a' + 10;
        if (c >= 'A' && c <= 'F')
            return c - 'A' + 10;
        return -1;
    }//w  w  w .j av  a 2  s .com
}

Related

  1. toDigit(char ch)
  2. toDigit(char ch, int index)
  3. toDigit(final boolean bit)
  4. toDigit(final char ch, final int index)