1 | module strings |
2 | |
3 | pub fn repeat(c u8, n int) string { |
4 | if n <= 0 { |
5 | return '' |
6 | } |
7 | arr := [c].repeat(n) |
8 | return arr.bytestr() |
9 | } |
10 | |
11 | pub fn repeat_string(s string, n int) string { |
12 | res := '' |
13 | #res.str = s.str.repeat(n.valueOf()) |
14 | |
15 | return res |
16 | } |