Standard library / strings
strings.ContainsRune()
Reports whether the input contains the requested Unicode code point; RuneError also matches invalid UTF-8. Expected stdout: 'true\n'.
Formal Syntax & Structure
go syntaxgo
func ContainsRune(s string, r rune) boolParameters & Attributes
| Name | Type | Description |
|---|---|---|
| s | string | Input text or sequence. |
| r | rune | Unicode code point. |
Return Value
bool
Reports whether the input contains the requested Unicode code point; RuneError also matches invalid UTF-8.
Working Example
Example Snippetgo
package main
import ( "fmt" "strings")
func main() { fmt.Println(strings.ContainsRune("سلام", 'ل'))}