Java tutorial
//package com.java2s; public class Main { public static String repeat(String s, int cnt) { StringBuilder sb = new StringBuilder(s.length() * cnt); for (int i = 0; i < cnt; i++) { sb.append(s); } return sb.toString(); } }