Standard library / bytes
bytes.ContainsAny()
Reports whether any code point in chars occurs in the input; chars is a set, not a substring. Expected stdout: 'true\n'.
Formal Syntax & Structure
go syntaxgo
func ContainsAny(b []byte, chars string) boolParameters & Attributes
| Name | Type | Description |
|---|---|---|
| b | []byte | Byte sequence or second comparison input. |
| chars | string | Set of Unicode code points to match. |
Return Value
bool
Reports whether any code point in chars occurs in the input; chars is a set, not a substring.
Working Example
Example Snippetgo
package main
import ( "bytes" "fmt")
func main() { fmt.Println(bytes.ContainsAny([]byte("café"), "éx"))}