Android Utililty Methods List Join

List of utility methods to do List Join

Description

The list of methods to do List Join are organized into topic(s).

Method

StringtoCommaSeperatedList(List values)
to Comma Seperated List
StringBuilder result = new StringBuilder();
for (String string : values) {
    result.append(",").append(string);
return result.toString().replaceFirst(",", "");
Stringimplode(List list, String glue)
implode
String str = "";
int i = 0;
for (Iterator it = list.iterator(); it.hasNext();) {
    Object object = (Object) it.next();
    if (i < list.size() - 1) {
        str += object.toString() + glue;
    } else {
        str += object.toString();
...
StringjoinList(String seperator, List list)
join List
return joinList(seperator, list, "");
StringjoinList(String seperator, List list, String def)
join List
if (list.isEmpty())
    return def;
StringBuilder b = new StringBuilder();
boolean first = true;
for (Object s : list) {
    if (!first)
        b.append(seperator);
    b.append(s.toString());
...