1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-08 22:52:29 +08:00

feat: add IsASCII

This commit is contained in:
dudaodong
2023-03-30 14:41:32 +08:00
parent 6453f755a6
commit e56a8a1ef5
5 changed files with 124 additions and 0 deletions

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
}