List of utility methods to do Array to String
String | arrayToString(String[] lengthsAndDelimiters) array To String String string = ""; for (String str : lengthsAndDelimiters) { string += str; string += "comma"; return string; |
String | arrayToString(String[] lines, String separator) array To String StringBuilder builder = new StringBuilder(); String prefix = ""; for (String s : lines) { builder.append(prefix).append(s); prefix = separator; return builder.toString(); |
String | arrayToString(String[] ngram) Convert an array to a String using spaces as glue String ret = ""; for (String aNgram : ngram) { ret += ngram + " "; return ret.trim(); |
String | arrayToString(String[] object) array To String String s = Arrays.toString(object); s = s.replaceAll("\\[|\\]", ""); return s; |
String | arrayToString(String[] s, String delim) Array to string. StringBuffer buf = new StringBuffer(); for (int i = 0; i < s.length; i++) { buf.append(s[i]).append(delim); return buf.toString().substring(0, buf.length() - 1); |
String | arrayToString(String[] str, char sep) Convert a string array to a string separated by some char. if (str == null) return null; StringBuffer sb = new StringBuffer(); for (int i = 0; i < str.length; i++) { sb.append(str[i]); sb.append(sep); return sb.toString(); ... |
String | arrayToString(String[] str, String separator) Convert String[] to String StringBuilder result = new StringBuilder(); if (str.length > 0) { result.append(str[0]); for (int i = 1; i < str.length; i++) { result.append(separator); result.append(str[i]); return result.toString(); |
String | arrayToString(String[] stringArray) array To String if (stringArray == null) { return "NULL"; if (stringArray.length == 0) { return "[]"; StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append('['); ... |
String | arrayToString(String[] stringArray) produces a single String representation of a stringArray. StringBuilder stringRep = new StringBuilder(); stringRep.append("["); for (int i = 0; i < stringArray.length; i++) { stringRep.append(stringArray[i]); if (i < stringArray.length) { stringRep.append(","); stringRep.append("]"); return stringRep.toString(); |
String | arrayToString(String[] strings) array To String StringBuffer result = new StringBuffer(""); if ((strings != null) && (strings.length > 0)) { for (int i = 0; i < strings.length; i++) { result.append(strings[i]); if (i < strings.length - 1) { result.append(", "); return result.toString(); |