repeatStr static method
Implementation
static String repeatStr(String r, int reps) {
// this if detection might be overcomplicated
if (reps == 0) {
return "";
}
if (reps == 1) {
return r;
}
StringBuffer buffer = StringBuffer();
for (int i = 0; i < reps; i++) {
buffer.write(r);
}
return buffer.toString();
}