Compare commits

..

1 Commits

Author SHA1 Message Date
373d28d405 added remove control characters func
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 1m37s
2026-03-10 19:54:28 +01:00

View File

@@ -3,6 +3,7 @@ package langext
import ( import (
"fmt" "fmt"
"strings" "strings"
"unicode"
) )
func StrLimit(val string, maxlen int, suffix string) string { func StrLimit(val string, maxlen int, suffix string) string {
@@ -136,3 +137,12 @@ func StrWrap(val string, linelen int, seperator string) string {
return res return res
} }
func StrRemoveControlCharacters(str string) string {
return strings.Map(func(r rune) rune {
if unicode.IsControl(r) {
return -1
}
return r
}, str)
}