Here you can find the source of repeat(String in, int count)
public static String repeat(String in, int count)
//package com.java2s; //License from project: Apache License import java.text.DecimalFormat; public class Main { public static String repeat(String in, int count) { if ((in == null) || (count < 1)) return ""; StringBuffer out = new StringBuffer(); for (int i = 0; i < count; i++) { out.append(in);// w ww. j a v a 2s . c o m } return out.toString(); } public static String toString(Object[] in) { StringBuffer desc = new StringBuffer(); desc.append("["); if (in != null) { for (int i = 0; i < in.length; i++) { desc.append(in[i]).append(";"); } } desc.append("]"); return desc.toString(); } public static String toString(double in, String format) { DecimalFormat formatter = new DecimalFormat(format); return formatter.format(in); } public static String toString(int in, String format) { DecimalFormat formatter = new DecimalFormat(format); return formatter.format(in); } }