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
for the sake of readability and portability:
public String repeat(String str, int count){ if(count <= 0) {return "";} return new String(new char[count]).replace("\0", str); }