bytes: add EqualFold

R=golang-dev, r, r
CC=golang-dev
https://golang.org/cl/5123047
This commit is contained in:
Russ Cox 2011-09-26 19:35:32 -04:00
parent 4bdf1fc02b
commit c68ae9d467
3 changed files with 85 additions and 1 deletions

View file

@ -584,7 +584,8 @@ func Replace(s, old, new string, n int) string {
return string(t[0:w])
}
// EqualFold returns true if s and t are equal under Unicode case-folding.
// EqualFold reports whether s and t, interpreted as UTF-8 strings,
// are equal under Unicode case-folding.
func EqualFold(s, t string) bool {
for s != "" && t != "" {
// Extract first rune from each string.