HasChinese

This commit is contained in:
jiangyong 2026-05-06 23:54:06 +08:00
parent 85867684a3
commit 7325bbc3b5
1 changed files with 9 additions and 0 deletions

View File

@ -28,3 +28,12 @@ func EncodeXMLIndent(v interface{}) string {
b, _ := xml.MarshalIndent(v, " ", " ")
return string(b)
}
func HasChinese(str string) bool {
for _, r := range str {
if unicode.Is(unicode.Han, r) {
return true
}
}
return false
}