Java String Implode implode(String[] input)

Here you can find the source of implode(String[] input)

Description

implode

License

Open Source License

Declaration

private static String implode(String[] input) 

Method Source Code

//package com.java2s;
//License from project: GNU General Public License 

public class Main {
    private static String implode(String[] input) {
        String result;// w  ww .j  a v a2 s  .  co m
        if (input.length == 0) {
            result = "";
        } else {
            StringBuffer sb = new StringBuffer();
            sb.append(input[0]);
            for (int i = 1; i < input.length; i++) {
                sb.append(",");
                sb.append(input[i]);
            }
            result = sb.toString();
        }
        return result;
    }
}

Related

  1. implode(String[] array, char delimiter)
  2. implode(String[] array, String glue)
  3. implode(String[] array, String separator)
  4. implode(String[] array, String separator)
  5. implode(String[] data, String delimiter)
  6. implode(String[] segments, String delimiter)
  7. implode(String[] strings, String delimiter)
  8. implode(String[] stringsArr, String glue)
  9. implode(StringBuilder sbuf, Object[] data, String separator)