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

feat: add IsPrintable

This commit is contained in:
dudaodong
2023-03-31 12:00:32 +08:00
parent 217350042b
commit bc25e7a037
5 changed files with 132 additions and 3 deletions

View File

@@ -428,3 +428,24 @@ func ExampleIsASCII() {
// false
// false
}
func ExampleIsPrintable() {
result1 := IsPrintable("ABC")
result2 := IsPrintable("{id: 123}")
result3 := IsPrintable("")
result4 := IsPrintable("😄")
result5 := IsPrintable("\u0000")
fmt.Println(result1)
fmt.Println(result2)
fmt.Println(result3)
fmt.Println(result4)
fmt.Println(result5)
// Output:
// true
// true
// true
// true
// false
}