strings.go
1package strings
2
3import (
4 "strings"
5)
6
7// HasPrefixFold tests whether the string s begins with prefix, interpreted as UTF-8 strings,
8// under Unicode case-folding.
9func HasPrefixFold(s, prefix string) bool {
10 return len(s) >= len(prefix) && strings.EqualFold(s[0:len(prefix)], prefix)
11}