Here you can find the source of toText(Object[] objs, String ch)
public static String toText(Object[] objs, String ch)
//package com.java2s; //License from project: Open Source License public class Main { public static String toText(Object[] objs, String ch) { StringBuffer text = new StringBuffer(); for (Object o : objs) { text.append(o.toString());/*from w w w . j a v a2 s .c o m*/ text.append(ch); } String t = text.toString().trim(); if (t.endsWith(ch)) { t = t.substring(0, t.length() - 1); } return t; } public static String toString(String[] ss) { StringBuffer buf = new StringBuffer(); if (ss != null) { for (String s : ss) { buf.append(s).append(' '); } } return buf.toString().trim(); } }