Java Char Convert To charToDecimal(char c)

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

Description

char To Decimal

License

Open Source License

Declaration

private static int charToDecimal(char c) 

Method Source Code

//package com.java2s;

public class Main {
    private static int charToDecimal(char c) {
        if (c >= '0' && c <= '9')
            return c - '0';
        else if (c >= 'a' && c <= 'z')
            return 10 + (c - 'a');
        throw new IllegalArgumentException("cannot convert " + c + " to decimal");
    }//from ww w  .  j a va2 s .c  o m
}

Related

  1. charToBuffer(char ch, byte[] ioBuffer)
  2. charToCDATA(char ch)
  3. charToCompressedBaseLow(final int base)
  4. charToCompressedBaseLow(final int base)
  5. charToCp1252(char c)
  6. charToDigit(char c)
  7. charToEscape(char ch)
  8. charToHTML(char ch, boolean xml)
  9. charToLong(final char value)