mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-27 19:51:41 +00:00
@ -57,3 +57,18 @@ func SplitAndTrim(s, sep, cutset string) []string {
|
||||
}
|
||||
return spl
|
||||
}
|
||||
|
||||
// Returns true if s is a non-empty printable non-tab ascii character.
|
||||
func IsASCIIText(s string) bool {
|
||||
if len(s) == 0 {
|
||||
return false
|
||||
}
|
||||
for _, b := range []byte(s) {
|
||||
if 32 <= b && b <= 126 {
|
||||
// good
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
Reference in New Issue
Block a user