Java Utililty Methods String Implode

List of utility methods to do String Implode

Description

The list of methods to do String Implode are organized into topic(s).

Method

Stringimplode(String glue, String[] inputArray)
implode
StringBuilder sb = new StringBuilder();
sb.append(inputArray[0]);
for (int i = 1; i < inputArray.length; i++) {
    sb.append(glue);
    sb.append(inputArray[i]);
return sb.toString();
Stringimplode(String glue, String[] pieces)
join a 'pieces' string array to a string
return implode(glue, pieces, 0);
Stringimplode(String glue, String[] pieces)
implode
String result = "";
String delimiter = "";
for (String piece : pieces) {
    result += delimiter + piece;
    delimiter = glue;
return result;
Stringimplode(String glue, String[] strArray)
implode
String ret = "";
for (int i = 0; i < strArray.length; i++) {
    ret += (i == strArray.length - 1) ? strArray[i] : strArray[i] + glue;
return ret;
Stringimplode(String glue, T[] array)
implode
if (array == null || array.length == 0) {
    return "";
StringBuilder sb = new StringBuilder();
sb.append(array[0]);
for (int i = 1; i < array.length; i++) {
    sb.append(glue).append(array[i]);
return sb.toString();
Stringimplode(String separator, String... data)
implode
StringBuilder sb = new StringBuilder();
for (int i = 0; i < data.length - 1; i++) {
    if (!data[i].matches(" *")) {
        sb.append(data[i]);
        sb.append(separator);
sb.append(data[data.length - 1].trim());
...
Stringimplode(String separator, String... data)
implode
StringBuilder sb = new StringBuilder();
boolean any = false;
for (int i = 0; i < data.length; i++) {
    if (data[i] != null && !data[i].matches(" *")) {
        sb.append(data[i]);
        any = true;
        if (i < data.length - 1 && data[i + 1] != null && !data[i + 1].matches(" *"))
            sb.append(separator);
...
Stringimplode(String... strings)
"Implodes" an array of strings into one string.
return implode(strings, "");
Stringimplode(String[] args)
implode
return implode(args, " ", 0);
Stringimplode(String[] arr_str, String pemisah)
Menggabung elemen array string
StringBuilder sb = new StringBuilder();
for (String s : arr_str) {
    sb.append(s + pemisah);
sb = sb.delete(sb.length() - pemisah.length(), sb.length());
return sb.toString();