Java List Join joinWordList(List wordList, String delimiter)

Here you can find the source of joinWordList(List wordList, String delimiter)

Description

join Word List

License

Apache License

Declaration

public static String joinWordList(List<String> wordList, String delimiter) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.List;

public class Main {
    public static String joinWordList(List<String> wordList, String delimiter) {

        if (wordList.size() == 0) {
            return null;
        }/*from w  ww .  j  ava2 s . c  o  m*/

        StringBuffer sb = new StringBuffer();
        for (String e : wordList) {
            if (sb.length() > 0) {
                sb.append(delimiter);
            }
            sb.append(e);
        }
        return sb.toString();
    }
}

Related

  1. joinThreads(List threads)
  2. joinTokens(final List tokens)
  3. joinToString(List list)
  4. JoinToString(List list, String delimiter)
  5. joinUnique(List list, T element)
  6. listToStr(List list, String joinChar)
  7. listToText(List list, String join)
  8. orderJoinType(List jList)
  9. reverseJoinType(List jList)