str

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 9, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package str @Title @Description @Author @Update

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Capitalize

func Capitalize(s string) string

Capitalize 首字母大写

func Compare

func Compare(a, b string) int

func Contains

func Contains(s, substr string) bool

func ContainsAny

func ContainsAny(s, chars string) bool

func Count

func Count(s, substr string) int

Count 返回substr在s中出现的次数

func Endswith

func Endswith(s, suffix string) bool

Endswith 判断是否以suffix结尾

func Fields

func Fields(s string) []string

func Find

func Find(s, substr string) int

func FindLast

func FindLast(s, substr string) int

func Index

func Index(s, substr string) int

func IndexLast

func IndexLast(s, substr string) int

func IsAlpha

func IsAlpha(s string) bool

func IsAlphaNum

func IsAlphaNum(s string) bool

func IsDigit

func IsDigit(s string) bool

func IsLower

func IsLower(s string) bool

func IsSpace

func IsSpace(s string) bool

func IsUpper

func IsUpper(s string) bool

func Join

func Join(sep string, elems ...string) string

func Len

func Len(s string) int

func Lower

func Lower(s string) string

func Max

func Max(s string) string

func Min

func Min(s string) string

func Replace

func Replace(s, old, new string, max int) string

func ReplaceAll

func ReplaceAll(s, old, new string) string

func Split

func Split(s, sep string) []string

func SplitLines

func SplitLines(s string, keepEnds bool) []string

func Startswith

func Startswith(s, prefix string) bool

Startswith 判断是否以prefix开头

func Strip

func Strip(s string, cutset string) string

func StripPrefix

func StripPrefix(s string, cutset string) string

func StripSuffix

func StripSuffix(s string, cutset string) string

func Title

func Title(s string) string

func Upper

func Upper(s string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL