Standard library / bytes

bytes.EqualFold()

Tests equality using Unicode simple case folding, not normalization or full multi-rune case folding. Expected stdout: 'true\n'.

Formal Syntax & Structure

go syntaxgo
func EqualFold(s, t []byte) bool

Parameters & Attributes

NameTypeDescription
s[]byteInput text or sequence.
t[]byteOther text to compare.

Return Value

bool

Tests equality using Unicode simple case folding, not normalization or full multi-rune case folding.

Working Example

Example Snippetgo
package main
import (  "bytes"  "fmt")
func main() {  fmt.Println(bytes.EqualFold([]byte("Go"), []byte("gO")))}
Go Reference