RosettaCodeData/Task/Repeat-a-string/Rust/repeat-a-string-1.rs

2 lines
73 B
Rust

std::iter::repeat("ha").take(5).collect::<String>(); // ==> "hahahahaha"