mirror of
https://github.com/unidoc/unioffice.git
synced 2025-04-25 13:48:53 +08:00

This is needed for pivot tables, split out from that branch so any further changes to filename handling will be easier in master.
14 lines
213 B
Go
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)
|
|
}
|