List of utility methods to do Char Create
int | toChars(int[] src, int srcOff, int srcLen, char[] dest, int destOff) Converts a sequence of unicode code points to a sequence of Java characters. if (srcLen < 0) { throw new IllegalArgumentException("srcLen must be >= 0"); int written = 0; for (int i = 0; i < srcLen; ++i) { written += Character.toChars(src[srcOff + i], dest, destOff + written); return written; ... |
char[] | toChars(String from) to Chars return from.toCharArray();
|
char[] | toChars(String s) Converts a String to char[]. int len = s.length(); char[] chars = new char[len]; s.getChars(0, len, chars, 0); return chars; |
CharSequence | toCharSequence(final Object value) Return the specified value as a CharSequence. return (value instanceof CharSequence) ? (CharSequence) value : String.valueOf(value); |
String | toCharString(byte[] bytes) to Char String StringBuilder sb = new StringBuilder(); for (int i = 0; i < bytes.length; i++) { char c = (char) (bytes[i] & 0xFF); sb.append(c); sb.append(' '); if (i % 8 == 7) { sb.append('\n'); sb.append(' '); ... |
char | toCharWithoutOverflow(double value) Like Math#toIntExact(long) but for char range. if (value < Character.MIN_VALUE || value > Character.MAX_VALUE) { throw new ArithmeticException("char overflow"); return (char) value; |