Methods Summary |
---|
public static int | digit(char ch, int radix)Returns the numeric value of the character ch in the
specified radix.
This is only supported for ISO-LATIN-1 characters.
int value = -1;
if (radix >= Character.MIN_RADIX && radix <= Character.MAX_RADIX) {
if (isDigit(ch)) {
value = ch - '0";
}
else if (isUpperCase(ch) || isLowerCase(ch)) {
// Java supradecimal digit
value = (ch & 0x1F) + 9;
}
}
return (value < radix) ? value : -1;
|
public static boolean | isDigit(char ch)Determines if the specified character is a digit.
This is currently only supported for ISO-LATIN-1 digits: "0" through "9".
return ch >= '0" && ch <= '9";
|
public static boolean | isLowerCase(char ch)Determines if the specified character is a lowercase character.
This is currently only supported for ISO-LATIN-1 characters: "a" through "z".
return ch >= 'a" && ch <= 'z";
|
public static boolean | isUpperCase(char ch)Determines if the specified character is an uppercase character.
This is currently only supported for ISO-LATIN-1 characters: "A" through "Z".
return ch >= 'A" && ch <= 'Z";
|
public static char | toLowerCase(char ch)The given character is mapped to its lowercase equivalent; if the
character has no lowercase equivalent, the character itself is
returned.
This is currently only supported for ISO-LATIN-1 characters.
if (isUpperCase(ch))
return (char)(ch + ('a" - 'A"));
else
return ch;
|
public static char | toUpperCase(char ch)Converts the character argument to uppercase; if the
character has no lowercase equivalent, the character itself is
returned.
This is currently only supported for ISO-LATIN-1 characters.
if (isLowerCase(ch))
return (char)(ch - ('a" - 'A"));
else
return ch;
|