repeatString function
Implementation
String repeatString(String str, int n) {
if (n == 0) {
return '';
} else if (n == 1) {
return str;
}
final strBuf = new StringBuffer();
for (int i = 0; i < n; i++) {
strBuf.write(str);
}
return strBuf.toString();
}