Standard library / strings
strings.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(s, chars string) boolParameters & Attributes
| Name | Type | Description |
|---|---|---|
| s | string | Input text or sequence. |
| 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 ( "fmt" "strings")
func main() { fmt.Println(strings.ContainsAny("café", "éx"))}