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 {
|
|
|
|
/*
|
|
|
|
// TODO: uncomment this. It is commented for now, so that `v doc strings` works
|
|
|
|
res := # s.repeat(n)
|
|
|
|
return res
|
|
|
|
*/
|
|
|
|
}
|