mirror of
https://github.com/moby/moby.git
synced 2026-08-07 08:31:39 +00:00
Co-Authored-by: Sebastiaan van Stijn <github@gone.nl> Signed-off-by: Josh Chorlton <jchorlton@gmail.com> Signed-off-by: Cory Snider <csnider@mirantis.com> Signed-off-by: Josh Chorlton <jchorlton@gmail.com>
12 lines
288 B
Go
12 lines
288 B
Go
package strings
|
|
|
|
import (
|
|
"strings"
|
|
)
|
|
|
|
// HasPrefixFold tests whether the string s begins with prefix, interpreted as UTF-8 strings,
|
|
// under Unicode case-folding.
|
|
func HasPrefixFold(s, prefix string) bool {
|
|
return len(s) >= len(prefix) && strings.EqualFold(s[0:len(prefix)], prefix)
|
|
}
|