feat: add ContainAny (#338)

Co-authored-by: Jiawen <im@linjiawen.com>
This commit is contained in:
JavenandJiawen authored and GitHub committed 2025-10-30 19:24:45 +08:00
1 parent fc624195c7
commit 350450bb67
7 files changed
+161

No files matched your search

+18
View File
@@ -58,6 +58,24 @@ func ExampleContainSubSlice() {
// false
}
func ExampleContainAny() {
result1 := ContainAny([]string{"a", "b", "c"}, []string{"a"})
result2 := ContainAny([]string{"a", "b", "c"}, []string{"d", "e"})
result3 := ContainAny([]string{"a", "b", "c"}, []string{"d", "a"})
result4 := ContainAny([]string{"a", "b", "c"}, []string{})
fmt.Println(result1)
fmt.Println(result2)
fmt.Println(result3)
fmt.Println(result4)
// Output:
// true
// false
// true
// false
}
func ExampleChunk() {
arr := []string{"a", "b", "c", "d", "e"}