mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
bytes: add EqualFold
R=golang-dev, r, r CC=golang-dev https://golang.org/cl/5123047
This commit is contained in:
parent
4bdf1fc02b
commit
c68ae9d467
3 changed files with 85 additions and 1 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue