List of utility methods to do Char Convert To
int | charToDigit(char c) char To Digit return CODEX.indexOf(c);
|
String | charToEscape(char ch) Return the Java Unicode escape sequence for the given character. String hexValue = Integer.toHexString(ch); if (hexValue.length() == 1) { return "\\u000" + hexValue; if (hexValue.length() == 2) { return "\\u00" + hexValue; if (hexValue.length() == 3) { ... |
String | charToHTML(char ch, boolean xml) Converts a character to HTML or XML entity. int c; if (ch == '<') { return ("<"); else if (ch == '>') { return (">"); else if (ch == '&') { ... |
Long | charToLong(final char value) char To Long return (long) value; |
char | charToLowerCase(char c) char To Lower Case if (c >= 'A' && c <= 'Z') return (char) (c - ('A' - 'a')); return c; |
String | charToNCRef(int c) Convert a single unicode scalar value to an XML numeric character reference. StringBuffer sb = new StringBuffer(); for (int i = 0, nDigits = (c > 0xFFFF) ? 6 : 4; i < nDigits; i++, c >>= 4) { int d = c & 0xF; char hd; if (d < 10) { hd = (char) ((int) '0' + d); } else { hd = (char) ((int) 'A' + (d - 10)); ... |
byte | charToNum(char c) char To Num switch (c) { case '0': return 0x0; case '1': return 0x1; case '2': return 0x2; case '3': ... |
int | charToNybble(char c) char To Nybble if (Character.isDigit(c)) { return c - '0'; return (Character.toUpperCase(c) - 'A') + 10; |
int | charToOctet(char c) char To Octet if (c > '9') { if (c > 'F') { return c - 'a' + 10; return c - 'A' + 10; return c - '0'; |
String | charToUpperOrLower(String string, int pos, boolean upper) Puts the given char to upper (true) or lower (false) case if (pos < 0 || pos >= string.length()) { throw new StringIndexOutOfBoundsException(pos); String ret = string.substring(0, pos); if (upper) { ret += string.substring(pos, pos + 1).toUpperCase(); } else { ret += string.substring(pos, pos + 1).toLowerCase(); ... |