I\'m looking for a simple commons method or operator that allows me to repeat some string n times. I know I could write this using a for loop, but I wish to avoid f
public static String rep(int a,String k) { if(a<=0) return ""; else {a--; return k+rep(a,k); }
You can use this recursive method for you desired goal.