2020-02-26 13:22:12 +01:00
|
|
|
module strings
|
|
|
|
|
|
|
|
pub fn repeat(c byte, n int) string {
|
|
|
|
if n <= 0 {
|
|
|
|
return ''
|
|
|
|
}
|
2020-08-10 18:05:26 +02:00
|
|
|
arr := [c].repeat(n)
|
|
|
|
return arr.bytestr()
|
2020-02-26 13:22:12 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
pub fn repeat_string(s string, n int) string {
|
2021-08-31 16:10:19 +02:00
|
|
|
return ''
|
2020-12-21 21:00:32 +01:00
|
|
|
/*
|
|
|
|
// TODO: uncomment this. It is commented for now, so that `v doc strings` works
|
2020-02-26 13:22:12 +01:00
|
|
|
res := # s.repeat(n)
|
|
|
|
return res
|
2020-12-21 21:00:32 +01:00
|
|
|
*/
|
2020-02-26 13:22:12 +01:00
|
|
|
}
|