Java String Implode implode(String[] strings, String delimiter)

Here you can find the source of implode(String[] strings, String delimiter)

Description

implode

License

LGPL

Declaration

public static String implode(String[] strings, String delimiter) 

Method Source Code

//package com.java2s;
//License from project: LGPL 

public class Main {
    public static String implode(String[] strings, String delimiter) {
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < strings.length - 1; i++) {
            sb.append(strings[i]).append(delimiter);
        }//from   www .  ja  va2 s.c  o  m
        if (strings.length > 0) {
            sb.append(strings[strings.length - 1]);
        }
        return sb.toString();
    }
}

Related

  1. implode(String[] array, String separator)
  2. implode(String[] array, String separator)
  3. implode(String[] data, String delimiter)
  4. implode(String[] input)
  5. implode(String[] segments, String delimiter)
  6. implode(String[] stringsArr, String glue)
  7. implode(StringBuilder sbuf, Object[] data, String separator)
  8. implode(T[] array, String delim)
  9. implodeParams(Object[] params)