List of utility methods to do Char Convert To
int | convertChar(char c) convert Char if ('0' <= c && c <= '9') { return c - '0'; } else if ('a' <= c && c <= 'f') { return c - 'a' + 0xa; } else if ('A' <= c && c <= 'F') { return c - 'A' + 0xa; } else { throw new IllegalArgumentException("Invalid hex character: " + c); ... |
Character | convertCharacter(final String value) convert Character if (value.length() > 0) { return Character.valueOf(value.charAt(0)); } else { return null; |
char | convertCharacterEntity(String value) convert Character Entity return convert(value);
|
int | convertCharacterOffsetToCodePointOffset(String inputStr, int charOffset) Computes the code point offset for the specified character offset in the input string return Character.codePointCount(inputStr, 0, charOffset);
|
String | convertCharacters(String fileName) convert Characters return fileName.replace(':', ' ').replace('|', ' ').replace('*', ' ').replace('?', ' '); |
Character[] | convertCharArray(char[] arr) convert Char Array Character[] ret = new Character[arr.length]; for (int i = 0; i < arr.length; i++) { ret[i] = arr[i]; return ret; |
int[] | convertCharArrayToIntArray(char[] chars) convert Char Array To Int Array int[] nums = new int[chars.length]; try { for (int i = 0; i < chars.length; i++) { nums[i] = Integer.parseInt(String.valueOf(chars[i])); } catch (NumberFormatException e) { e.printStackTrace(); return nums; |
String | convertChars(String orig_name, String chars, char toChar) convert Chars StringBuffer tmp = new StringBuffer(orig_name); int i; for (i = 0; i < tmp.length(); i++) { if (chars.indexOf(tmp.charAt(i)) != -1) { tmp.setCharAt(i, toChar); return new String(tmp); ... |
String | convertCharSet(String str, String desCharset) convert Char Set return convertCharSet(str, null, desCharset);
|
String | convertCharsToUnicodeChars(final String s, final boolean toLowerCase) Converts all characters from the given String to unicodes characters encoded like \uxxxx. if (s == null || s.length() == 0) { return s; int length = s.length(); int sbLength = length * 2; StringBuilder sb = new StringBuilder(sbLength); for (int i = 0; i < length; i++) { char c = s.charAt(i); ... |