Rust生成重复字符的字符串

std::iter::repeat('x').take(len).collect::<String>()

来源:https://users.rust-lang.org/t/fill-string-with-repeated-character/1121

posted @ 2024-09-28 14:09  寻找繁星  阅读(3)  评论(0编辑  收藏  举报