Documentation ¶
Overview ¶
Package zstring provides String related operations
Index ¶
- Constants
- func Buffer() (b strings.Builder)
- func Bytes2String(b []byte) string
- func CamelCaseToSnakeCase(str string, delimiter ...string) string
- func IsLcfirst(str string) bool
- func IsPattern(str string) bool
- func IsUcfirst(str string) bool
- func Lcfirst(str string) string
- func Len(str string) int
- func Match(str, pattern string) bool
- func Pad(raw string, length int, padStr string, padType int) string
- func Rand(n int, tpl ...string) string
- func RandInt(min int, max int) int
- func RegexExtract(pattern string, str string) ([]string, error)
- func RegexFind(pattern string, str string, n int) [][]int
- func RegexMatch(pattern string, str string) bool
- func RegexReplace(pattern string, str, repl string) (string, error)
- func RegexReplaceFunc(pattern string, str string, repl func(string) string) (string, error)
- func SnakeCaseToCamelCase(str string, ucfirst bool, delimiter ...string) string
- func String2Bytes(s string) []byte
- func Substr(str string, start int, length ...int) string
- func TrimBOM(fileBytes []byte) []byte
- func Ucfirst(str string) string
- func XssClean(str string) string
Constants ¶
View Source
const ( // PadRight Right padding character PadRight int = iota // PadLeft Left padding character PadLeft // PadSides Two-sided padding characters,If the two sides are not equal, the right side takes precedence. PadSides )
Variables ¶
This section is empty.
Functions ¶
func CamelCaseToSnakeCase ¶ added in v0.0.19
CamelCaseToSnakeCase camelCase To SnakeCase helloWorld/HelloWorld => hello_world
func Rand ¶
RandString random string of specified length, the second parameter limit can only appear the specified character
func RegexExtract ¶ added in v0.0.19
RegexExtract extract matching text
func RegexMatch ¶ added in v0.0.19
RegexMatch check for match
func RegexReplace ¶ added in v0.0.19
RegexReplace replacing matches of the Regexp
func RegexReplaceFunc ¶ added in v0.0.19
RegexReplaceFunc replacing matches of the Regexp
func SnakeCaseToCamelCase ¶ added in v0.0.19
SnakeCaseToCamelCase snakeCase To CamelCase: hello_world => helloWorld
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.