Java Character get character name

Description

Java Character get character name

public class Main {

   public static void main(String[] args) {
      int x = 0;//w  w w . j  a  va  2 s . c om
      for (int c = 0; c <= 0x10FFFF; c++) {
         if (Character.isDigit(c)) {
            ++x;
            System.out.printf("Codepoint: 0x%04X\tCharacter: %c\tDigit: %d\tName: %s\n", c, c, Character.digit(c, 10),
                  Character.getName(c));
         }
      }
      System.out.printf("Total digits: %d\n", x);
   }
}



PreviousNext

Related