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