Files
tiny-rdm/backend/utils/string/common.go
tiny-craft e28d091500 refactor: split connection_service into connection_service and browser_service in go
refactor: split connectionStore into connectionStore and browserStore in js
2023-11-05 11:58:59 +08:00

23 lines
378 B
Go

package strutil
import (
"unicode"
)
func containsBinary(str string) bool {
//size := 0
//for start := 0; start < len(buf); start += size {
// var r rune
// if r, size = utf8.DecodeRune(buf[start:]); r == utf8.RuneError {
// return true
// }
//}
rs := []rune(str)
for _, r := range rs {
if !unicode.IsPrint(r) && r != '\n' {
return true
}
}
return false
}