Java Utililty Methods ArrayList Join

List of utility methods to do ArrayList Join

Description

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

Method

Stringjoin(final ArrayList array, final String separator)
join
StringBuffer result = new StringBuffer();
if (array != null && array.size() > 0) {
    for (String str : array) {
        result.append(str);
        result.append(separator);
    result.delete(result.length() - 1, result.length());
return result.toString();
Stringjoin(final ArrayList arry, final String with)
This method is used to link to string array.
StringBuffer buf = new StringBuffer();
for (int i = 0; i < arry.size(); i++) {
    if (buf.length() > 0) {
        buf.append(with);
    buf.append(arry.get(i));
return buf.toString();
...
Stringjoin(final ArrayList parts, final char separator)
join
final int size = parts.size();
int destSize = size - 1;
for (int i = 0; i < size; ++i) {
    destSize += parts.get(i).length();
final StringBuilder buf = new StringBuilder(destSize);
int i = 0;
for (final int n = size - 1; i < n; ++i) {
...
Stringjoin(String glue, ArrayList a)
join
String answer = "";
String join = "";
for (int i = 0; i < a.size(); i++) {
    String s = (String) a.get(i);
    answer += join + s;
    join = glue;
return answer;
...
StringjoinArrayList(List coll, String delimiter)
join Array List
if (coll.isEmpty()) {
    return "";
StringBuilder sb = new StringBuilder();
for (String x : coll) {
    sb.append(x).append(delimiter);
sb.delete(sb.length() - delimiter.length(), sb.length());
...
StringjoinArrayList(String joiner, ArrayList array)
join Array List
String result = "";
for (int i = 0; i < array.size(); i++) {
    result += array.get(i);
    if (i < array.size() - 1) {
        result += joiner;
return result;
...
StringjoinCommandLine(ArrayList lsCmdl)
Joins a command line to a string.
String sCmdl = "";
if (lsCmdl != null)
    for (int i = 0; i < lsCmdl.size(); i++)
        if (lsCmdl.get(i) != null && lsCmdl.get(i).length() > 0) {
            if (i > 0)
                sCmdl += " ";
            sCmdl += lsCmdl.get(i);
return sCmdl;
StringjoinList(ArrayList list, String joint)
join List
StringBuilder joinedList = new StringBuilder();
for (String item : list) {
    joinedList.append(item);
    joinedList.append(joint);
if (joinedList.length() > 0)
    joinedList.setLength(joinedList.length() - 1);
return joinedList.toString();
...