GO语言bytes包ContainsAny函数的用法及代码示例。

用法:

func ContainsAny(b []byte, chars string) bool

ContainsAny报告char中任何UTF-8编码的代码点是否在b之内。

▾示例

package main

import (
    "bytes"
    "fmt"
)

func main() {
    fmt.Println(bytes.ContainsAny([]byte("I like seafood."), "fÄo!"))
    fmt.Println(bytes.ContainsAny([]byte("I like seafood."), "去是伟大的."))
    fmt.Println(bytes.ContainsAny([]byte("I like seafood."), ""))
    fmt.Println(bytes.ContainsAny([]byte(""), ""))
}