strings.go 288 B

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