Java tutorial
//package com.java2s; public class Main { public static String repeat(String str, int times) { StringBuffer sbf = new StringBuffer(); for (int i = 0; i < times; i++) { sbf.append(str); } return sbf.toString(); } }