Java StringJoiner Usage joinRepeating(String element, String delimiter, int times)

Here you can find the source of joinRepeating(String element, String delimiter, int times)

Description

join Repeating

License

Open Source License

Declaration

public static String joinRepeating(String element, String delimiter, int times) 

Method Source Code


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

import java.util.StringJoiner;

public class Main {
    public static String joinRepeating(String element, String delimiter, int times) {

        StringJoiner joiner = new StringJoiner(delimiter);

        for (int i = 0; i < times; ++i) {
            joiner.add(element);//from   w ww .j  a v  a2s.com
        }

        return joiner.toString();

    }
}

Related

  1. implodeString(Iterable strings, String delimiter)
  2. incrementalComputationOfComponentWiseAverage(List average, int n, List newItems)
  3. join(Collection data, String delimiter)
  4. join(final String left, final String right)
  5. join(String separator, Collection c)
  6. joinToString(String sep, Iterable items)
  7. listToString(List list)
  8. print(int[] a)
  9. split(String s)