This repository has been archived on 2025-03-16. You can view files and clone it, but cannot push or open issues or pull requests.
chkbit/cmd/chkbit/util/strings.go
Christian Zangl b3c7aeed4c
refactor
2024-08-16 23:10:58 +02:00

12 lines
141 B
Go

package util
func LeftTruncate(s string, nMax int) string {
for i := range s {
nMax--
if nMax < 0 {
return s[:i]
}
}
return s
}