feat: add IsPrintable

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

No files matched your search

+21
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
}