Trim系列
func Trim(s string, cutset string) string
func TrimSpace(s string) string
func TrimFunc(s string, f func(rune) bool) string
func TrimLeft(s string, cutset string) string
func TrimLeftFunc(s string, f func(rune) bool) string
func TrimPrefix(s, prefix string) string
func TrimRight(s string, cutset string) string
func TrimRightFunc(s string, f func(rune) bool) string
func TrimSuffix(s, suffix string) string
Fields系列
func Fields(s string) []string
func FieldsFunc(s string, f func(rune) bool) []string
Split系列
func Split(s, sep string) []string
func SplitN(s, sep string, n int) []string
func SplitAfter(s, sep string) []string
func SplitAfterN(s, sep string, n int) []string
To系列
func ToLower(s string) string
func ToLowerSpecial(_case unicode.SpecialCase, s string) string
func ToUpper(s string) string
func ToUpperSpecial(_case unicode.SpecialCase, s string) string
func ToTitle(s string) string
func ToTitleSpecial(_case unicode.SpecialCase, s string) string
Index系列
func Index(s, sep string) int
func IndexByte(s string, c byte) int
func IndexRune(s string, r rune) int
func IndexAny(s, chars string) int
func IndexFunc(s string, f func(rune) bool) int
Has系列
func HasPrefix(s, prefix string) bool
func HasSuffix(s, suffix string) bool
Contains系列
func Contains(s, substr string) bool
func ContainsRune(s string, r rune) bool
func ContainsAny(s, chars string) bool
Last系列
func LastIndex(s, sep string) int
func LastIndexAny(s, chars string) int
func LastIndexFunc(s string, f func(rune) bool) int
其他系列
func Join(a []string, sep string) string
func Repeat(s string, count int) string
func Replace(s, old, new string, n int) string
func Map(mapping func(rune) rune, s string) string
func Title(s string) string
func Count(s, sep string) int
func EqualFold(s, t string) bool
有疑问加站长微信联系(非本文作者)