Java Collection Concatenate concatNames(Collection cNames, String split)

Here you can find the source of concatNames(Collection cNames, String split)

Description

concat Names

License

Open Source License

Declaration

public static String concatNames(Collection<String> cNames, String split) 

Method Source Code

//package com.java2s;

import java.util.*;

public class Main {
    public static String concatNames(Collection<String> cNames, String split) {
        String cNames$ = "";
        for (String name : cNames)
            cNames$ += name + split;//from w  ww  .  j a v a 2  s  .co m
        if (cNames$.length() > 0)
            cNames$ = cNames$.substring(0, cNames$.length() - 1);
        return cNames$;
    }

    public static String concatNames(String[] cNames, String split) {
        String cNames$ = "";
        for (String name : cNames)
            cNames$ += name + split;
        if (cNames$.length() > 0)
            cNames$ = cNames$.substring(0, cNames$.length() - 1);
        return cNames$;
    }

    public static String concatNames(double[] cNames, String split) {
        String cNames$ = "";
        for (double name : cNames)
            cNames$ += "" + name + split;
        if (cNames$.length() > 0)
            cNames$ = cNames$.substring(0, cNames$.length() - 1);
        return cNames$;
    }
}

Related

  1. concatenatedLTL(Collection ltl)
  2. concatenateIds(final Collection ids)
  3. concatenateWithComma(Collection collection)
  4. concatEntries(Collection coll, String sep, String lastSep)
  5. concatInt(Collection collection)
  6. concatNumber(Collection keys)
  7. concatStrings(Collection strings)
  8. concatStrings(Collection values, String separator)
  9. concatStringsWSep(Collection strings, String separator)