feat: add IsASCII

This commit is contained in:
dudaodong committed 2023-03-30 14:41:32 +08:00
1 parent 6453f755a6
commit e56a8a1ef5
5 files changed
+124

No files matched your search

+21
View File
@@ -407,3 +407,24 @@ func ExampleIsGBK() {
// Output:
// true
}
func ExampleIsASCII() {
result1 := IsASCII("ABC")
result2 := IsASCII("123")
result3 := IsASCII("")
result4 := IsASCII("😄")
result5 := IsASCII("你好")
fmt.Println(result1)
fmt.Println(result2)
fmt.Println(result3)
fmt.Println(result4)
fmt.Println(result5)
// Output:
// true
// true
// true
// false
// false
}