Repeat a string
import "std/string.zc"
fn main() {
let s = String::new("");
for _ in 0..5 { s.append_c("ha"); }
println "";
}
Output:
hahahahaha
Attribution: This is a community solution for the Rosetta Code task Repeat a string in Zen C.
This article uses material from the Rosetta Code article Repeat a string, which is released under the GNU Free Documentation License 1.3. A list of the original authors can be found in the page history.