mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
strings, bytes: clarify usage of EqualFolds
This clarifies meaning of "case folding" Unicode equality with more familiar "case insensitive" wording.
For case folding properties see ftp://ftp.unicode.org/Public/UNIDATA/CaseFolding.txt.
Fixes #33447
Change-Id: I6ee85ab398679bf2a0b7d18693985ff0979d6c5a
GitHub-Last-Rev: accc915933
GitHub-Pull-Request: golang/go#34434
Reviewed-on: https://go-review.googlesource.com/c/go/+/196717
Reviewed-by: Rob Pike <r@golang.org>
This commit is contained in:
parent
9c0e56bf9d
commit
78e5288b5c
2 changed files with 4 additions and 2 deletions
|
|
@ -969,7 +969,8 @@ func ReplaceAll(s, old, new string) string {
|
|||
}
|
||||
|
||||
// EqualFold reports whether s and t, interpreted as UTF-8 strings,
|
||||
// are equal under Unicode case-folding.
|
||||
// are equal under Unicode case-folding, which is a more general
|
||||
// form of case-insensitivity.
|
||||
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