Java String Implode implode(String glue, String[] strArray)

Here you can find the source of implode(String glue, String[] strArray)

Description

implode

License

Open Source License

Declaration

public static String implode(String glue, String[] strArray) 

Method Source Code

//package com.java2s;

public class Main {
    public static String implode(String glue, String[] strArray) {
        String ret = "";
        for (int i = 0; i < strArray.length; i++) {
            ret += (i == strArray.length - 1) ? strArray[i] : strArray[i] + glue;
        }/*ww w. ja  v  a 2 s. c om*/
        return ret;
    }
}

Related

  1. implode(String delimiter, String[] strings)
  2. implode(String glue, String... parts)
  3. implode(String glue, String[] inputArray)
  4. implode(String glue, String[] pieces)
  5. implode(String glue, String[] pieces)
  6. implode(String glue, T[] array)
  7. implode(String separator, String... data)
  8. implode(String separator, String... data)
  9. implode(String... strings)