mirror of
https://github.com/hanzoai/team.git
synced 2026-09-30 01:57:35 +00:00
19 lines
378 B
Go
19 lines
378 B
Go
package model
|
|
|
|
import (
|
|
"unicode"
|
|
)
|
|
|
|
// ContainsCJK returns true if the string contains any CJK (Chinese, Japanese, Korean) characters.
|
|
func ContainsCJK(s string) bool {
|
|
for _, r := range s {
|
|
if unicode.Is(unicode.Han, r) ||
|
|
unicode.Is(unicode.Hiragana, r) ||
|
|
unicode.Is(unicode.Katakana, r) ||
|
|
unicode.Is(unicode.Hangul, r) {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|