Java Object to String toText(Object[] objs, String ch)

Here you can find the source of toText(Object[] objs, String ch)

Description

to Text

License

Open Source License

Declaration

public static String toText(Object[] objs, String ch) 

Method Source Code

//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();
    }
}

Related

  1. toString(Object object, Class objectClass)
  2. toString(Object val)
  3. toString(Object value)
  4. toString(Object value)
  5. toString(Object value)
  6. toText(T t)