11 lines
259 B
Text
11 lines
259 B
Text
|
|
void setup() {
|
||
|
|
String rep = repeat("ha", 5);
|
||
|
|
println(rep);
|
||
|
|
}
|
||
|
|
String repeat(String str, int times) {
|
||
|
|
// make an array of n chars,
|
||
|
|
// replace each char with str,
|
||
|
|
// and return as a new String
|
||
|
|
return new String(new char[times]).replace("\0", str);
|
||
|
|
}
|