code.dwrz.net

Go monorepo.
Log | Files | Refs

strings.go (288B)


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