stringx

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2023 License: MIT Imports: 4 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// LOrU
	// Uppercase or lowercase letter
	LOrU = L | U
	// DefaultPasswdFlag
	// Include Number and Letter
	DefaultPasswdFlag = N | LOrU
)

Variables

This section is empty.

Functions

func CutString

func CutString(s string, runeIndex int, keepIndex bool) (string, string)

CutString 把字符串一分为二 当keepIndex=true是,index所在字符会留在第二个返回字符的第一个

func GetRuneCount

func GetRuneCount(str string) int

GetRuneCount 取字符串的字符个数

func HasSuffixAt

func HasSuffixAt(str string, prefix string, tOffset int) bool

func IndexOfString

func IndexOfString(s string, char string) int

IndexOfString 取单个字符的首位置

func LastIndexOfString

func LastIndexOfString(s string, char string) int

LastIndexOfString 取单个字符的尾位置

func PasswordCheck

func PasswordCheck(pwd string, flag PasswdFlag, minLen int, maxLen int) bool

func Print added in v1.0.4

func Print(args ...interface{}) string

Print 字符串拼接

func PrintSafe added in v1.0.4

func PrintSafe(args ...interface{}) string

PrintSafe 字符串拼接

func SplitToken

func SplitToken(str string, separator string, trimTokens bool, ignoreEmptyTokens bool) []string

func SubPrefix

func SubPrefix(s string, index int) string

SubPrefix 截取前部分

func SubStr

func SubStr(s string, startIndex, length int) string

SubStr 截取子字符串

func SubString

func SubString(s string, startIndex, endIndex int) string

SubString 截取子字符串

func SubSuffix

func SubSuffix(s string, index int) string

SubSuffix 截取后部分

Types

type PasswdFlag

type PasswdFlag int
const (
	// N Numbers
	N PasswdFlag = 1 << iota
	// L Lowercase letters
	L
	// U Uppercase letter
	U
	// S Symbols found on the keyboard (all keyboard characters not defined as letters or numerals) and spaces
	S
)

Jump to

Keyboard shortcuts

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