Java List Concatenate toString(List _toString, String _concator)

Here you can find the source of toString(List _toString, String _concator)

Description

Wandelt eine Liste in Liste von Strings um

License

Open Source License

Parameter

Parameter Description
T a parameter
_toString a parameter
_concator a parameter

Declaration

public static <T> String toString(List<T> _toString, String _concator) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.List;

public class Main {
    /**/*www.j av a2 s  .  c  o  m*/
     * Wandelt eine Liste in Liste von Strings um
     * 
     * @param <T>
     * @param _toString
     * @param _concator
     * @return
     */
    public static <T> String toString(List<T> _toString, String _concator) {
        StringBuffer sb = new StringBuffer();

        for (int i = 0, m = _toString.size(); i < m; i++) {
            sb.append(_toString.get(i));

            if ((i + 1) != m) {
                sb.append(_concator);
            }
        }

        return sb.toString();
    }
}

Related

  1. getConcatenatedStringFromList(List input, String delimiter)
  2. getConcatenateString(List codes)
  3. getConcatinatedRange(List numbers)
  4. getZipAndConcatenated(List input1, List input2, String delimiter)
  5. listToConcatenatedString(List stringList, String delimiter)