Java Utililty Methods Char Array to String

List of utility methods to do Char Array to String

Description

The list of methods to do Char Array to String are organized into topic(s).

Method

CharSequencecharArrayToCharSequence(final char[] charArray)
char Array To Char Sequence
return new StringBuilder().append(charArray == null ? new char[0] : charArray);
StringcharArrayToString(char[] ch, String separator)
char Array To String
StringBuffer sb = new StringBuffer();
for (int i = 0; i < ch.length; i++) {
    sb.append(ch[i]);
    if (ch.length != (i + 1)) {
        sb.append(separator);
return sb.toString();
...
StringcharArrayToString(char[] input, int offset, int length, int maxChars)
Converts a subset of a character array to a String representation.
StringBuffer buf = new StringBuffer();
boolean inHex = false;
if (length < 0) {
    length = input.length;
} else {
    length = offset + length;
if (length > input.length) {
...
StringcharArrayToString(Character[] chars)
char Array To String
String result = "";
for (Character character : chars) {
    result += character.toString();
return result;
StringcharArrayToXml(char[] input, int offset, int length)
Converts a subset of a character array to XML string format.
StringBuffer buf = new StringBuffer();
if (length < 0) {
    length = input.length;
} else {
    length = offset + length;
if (length > input.length) {
    length = input.length;
...
StringcharsToString(char[] chars)
Converts a binary zero terminated char-array to a string.
int lastBinZero = chars.length - 1;
while (lastBinZero >= 0 && chars[lastBinZero] == 0) {
    lastBinZero--;
return new String(chars, 0, lastBinZero + 1);
StringcharsToString(char[] chars)
chars To String
StringBuilder sb = new StringBuilder(chars.length);
for (int i = 0; i < chars.length; i++) {
    sb.append(chars[i]);
return sb.toString();