Standard library / bytes
bytes.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(b []byte, r rune) boolParameters & Attributes
| Name | Type | Description |
|---|---|---|
| b | []byte | Byte sequence or second comparison input. |
| 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 ( "bytes" "fmt")
func main() { fmt.Println(bytes.ContainsRune([]byte("سلام"), 'ل'))}