added remove control characters func
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 1m37s

This commit is contained in:
2026-03-10 19:54:28 +01:00
parent 8aaf2cd257
commit 373d28d405

View File

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