kbstring

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2022 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// PadRight Right padding character
	PadRight int = iota
	// PadLeft Left padding character
	PadLeft
)

Variables

This section is empty.

Functions

func Buffer

func Buffer(size ...int) *strings.Builder

Buffer Buffer

func Bytes2String

func Bytes2String(b []byte) string

Bytes2String bytes to string

func CamelCaseToSnakeCase

func CamelCaseToSnakeCase(str string, delimiter ...string) string

CamelCaseToSnakeCase camelCase To SnakeCase helloWorld/HelloWorld => hello_world

func Len

func Len(str string) int

Len string length (utf8)

func Match

func Match(str, pattern string) bool

字符串匹配

func Md5

func Md5(str string) string

func Md5File

func Md5File(path string) (encrypt string, err error)

func Pad

func Pad(raw string, length int, padStr string, padType int) string

Pad String padding

func RegexExtract

func RegexExtract(pattern string, str string) ([]string, error)

RegexExtract extract matching text

func RegexMatch

func RegexMatch(pattern string, str string) bool

RegexMatch check for match

func RegexReplace

func RegexReplace(pattern string, str, repl string) (string, error)

RegexReplace replacing matches of the Regexp

func RegexReplaceFunc

func RegexReplaceFunc(pattern string, str string, repl func(string) string) (string, error)

RegexReplaceFunc replacing matches of the Regexp

func SnakeCaseToCamelCase

func SnakeCaseToCamelCase(str string, ucfirst bool, delimiter ...string) string

SnakeCaseToCamelCase snakeCase To CamelCase: hello_world => helloWorld

func String2Bytes

func String2Bytes(s string) []byte

String2Bytes string to bytes remark: read only, the structure of runtime changes will be affected, the role of unsafe.Pointer will be changed, and it will also be affected

func Substr

func Substr(str string, start int, length ...int) string

Substr returns part of a string

func TrimSpace

func TrimSpace(s string) string

TrimSpace TrimSpace

func XSSClean

func XSSClean(str string) string

XSSClean clean html tag

Types

This section is empty.

Jump to

Keyboard shortcuts

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