mirror of
https://github.com/corda/corda.git
synced 2025-06-12 20:28:18 +00:00
implement Character.forDigit
This commit is contained in:
@ -109,6 +109,15 @@ public final class Character implements Comparable<Character> {
|
||||
}
|
||||
}
|
||||
|
||||
public static char forDigit(int digit, int radix) {
|
||||
if (MIN_RADIX <= radix && radix <= MAX_RADIX) {
|
||||
if (0 <= digit && digit < radix) {
|
||||
return (char) (digit < 10 ? digit + '0' : digit + 'a' - 10);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static boolean isLetter(int c) {
|
||||
return canCastToChar(c) && isLetter((char) c);
|
||||
}
|
||||
|
Reference in New Issue
Block a user