public static int getEuropeanDigit ( int ch ) { if ( ( ch > 0x7a && ch < 0xff21 ) || ch < 0x41 || ( ch > 0x5a && ch < 0x61 ) || ch > 0xff5a || ( ch > 0xff3a && ch < 0xff41 ) ) { return - 1 ; } if ( ch <= 0x7a ) { // ch >= 0x41 or ch < 0x61 return ch + 10 - ( ( ch <= 0x5a ) ? 0x41 : 0x61 ) ; } // ch >= 0xff21 if ( ch <= 0xff3a ) { return ch + 10 - 0xff21 ; } // ch >= 0xff41 && ch <= 0xff5a return ch + 10 - 0xff41 ; }
Returns the digit values of characters like A - Z normal half - width and full - width . This method assumes that the other digit characters are checked by the calling method .