Here you can find the source of joinRepeating(String element, String delimiter, int times)
public static String joinRepeating(String element, String delimiter, int times)
//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(); } }