Files
herolib/lib/core/texttools/expand.v
2024-12-25 09:23:31 +01:00

14 lines
228 B
V

module texttools
// texttools.expand('|', 20, ' ')
pub fn expand(txt_ string, l int, expand_with string) string {
mut txt := txt_
for _ in 0 .. l {
txt += expand_with
}
if txt.len > l {
txt = txt[0..l]
}
return txt
}