1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-07 06:02:27 +08:00

feat: add IsNotBlank func (#132)

Co-authored-by: yuanyou <yuanyou@kezaihui.com>
This commit is contained in:
elza
2023-09-13 15:29:26 +08:00
committed by GitHub
parent b698fec50f
commit f445ecbaf8
6 changed files with 119 additions and 0 deletions

View File

@@ -479,6 +479,26 @@ func ExampleIsBlank() {
// false
}
func ExampleIsNotBlank() {
result1 := IsNotBlank("")
result2 := IsNotBlank(" ")
result3 := IsNotBlank("\t\v\f\n")
result4 := IsNotBlank(" 中文")
result5 := IsNotBlank(" world ")
fmt.Println(result1)
fmt.Println(result2)
fmt.Println(result3)
fmt.Println(result4)
fmt.Println(result5)
// Output:
// false
// false
// false
// true
// true
}
func ExampleHasPrefixAny() {
result1 := HasPrefixAny("foo bar", []string{"fo", "xyz", "hello"})
result2 := HasPrefixAny("foo bar", []string{"oom", "world"})