unioffice/algo/strings.go
Todd 89b1416b8f gooxml: rework how filenames are calculated
This is needed for pivot tables, split out from that branch
so any further changes to filename handling will be easier in
master.
2017-09-28 18:20:56 -05:00

14 lines
213 B
Go

package algo
func RepeatString(s string, cnt int) string {
if cnt <= 0 {
return ""
}
buf := make([]byte, len(s)*cnt)
sb := []byte(s)
for i := 0; i < cnt; i++ {
copy(buf[i:], sb)
}
return string(buf)
}