Documentation ¶
Index ¶
- Variables
- func AsciiChar(i int) string
- func AsciiNum(s string) (int, error)
- func Contains(s, substr string) bool
- func ContainsIgnore(s, substr string) bool
- func Count(s string, substr string) int
- func CountChar(s string) map[string]int
- func CountIgnore(s string, substr string) int
- func Cut(s, start, end string) string
- func FilterIDNumber(idNumber string) string
- func FilterName(name string) string
- func FilterWithMarkFirstAndLast(s, tag string) string
- func FilterWithMarkRetainFirstN(s, tag string, n int) string
- func FilterWithMarkRetainLastN(s, tag string, n int) string
- func FilterWithMarkRetainN(s, tag string, firstN, lastN int) string
- func Index(s, substr string) int
- func IndexIgnore(s, substr string) int
- func IndexRune(s string, r rune) int
- func IndexRuneAny(s string, r rune) int
- func IsEmpty(s string) bool
- func IsLower(s string) bool
- func IsNotEmpty(s string) bool
- func IsNumeric(s string) bool
- func IsUpper(s string) bool
- func Join(s []string, sep string) string
- func JoinAny[T any](s []T, sep string, typs ...joinAnyStruct) string
- func JoinVal[T bztype.Numeric | bool](s []T, sep string) string
- func RandStr(n int) string
- func Repeat(s string, repeatTimes int) string
- func Replace(s, old, new string, n ...int) string
- func ReplaceAllByMap(s string, m map[string]string) string
- func ReplaceAllWithBraceByMap(s string, m map[string]string) string
- func ReplaceAllWithSquareBraceByMap(s string, m map[string]string) string
- func Reverse(s string) string
- func RuneLen(s string) int
- func Split(s string, sep string) []string
- func SplitN(s string, sep string, n int) []string
- func SplitRetain(s string, sep string) []string
- func SplitRetainN(s string, sep string, n int) []string
- func Substr(s string, start int, length ...int) string
- func ToByte(s string) []byte
- func ToDecimal(num float64, i int) string
- func ToFloat(s string) (float64, error)
- func ToInt(s string) (int64, error)
- func ToLower(s string) string
- func ToLowerFirst(s string) string
- func ToUpper(s string) string
- func ToUpperFirst(s string) string
- func ToUpperWords(s string) string
- func Utf8Encode(s string) string
Constants ¶
This section is empty.
Variables ¶
var ( JoinAnyStructKV = joinAnyStruct{/* contains filtered or unexported fields */} JoinAnyStructAll = joinAnyStruct{/* contains filtered or unexported fields */} )
Functions ¶
func ContainsIgnore ¶
func Count ¶
Count 统计字符在字符串中出现的次数 Count(s string, substr string) int @param s string 字符串 @param substr string 统计字符 @return int 出现的次数
func CountChar ¶
CountChar 统计每个字符在字符串中出现的次数 CountIgnore(s string) map[string]int @param s string 字符串 @return map[string]int 字符和出现的次数
func CountIgnore ¶
CountIgnore 统计字符在字符串中出现的次数,忽略大小写 CountIgnore(s string, substr string) int @param s string 字符串 @param substr string 统计字符 @return int 出现的次数
func FilterName ¶
FilterName 过滤姓名 FilterName(name string) string @param name string 需要过滤的姓名 @return string 过滤后的姓名
func FilterWithMarkRetainN ¶
func IndexIgnore ¶
func IndexRuneAny ¶
func IsNotEmpty ¶
IsNotEmpty 判断字符串是否不为空 IsNotEmpty(s string) bool @param s string 字符串 @return bool 是否不为空
func Join ¶
Join 将切片合并为字符串 Join(s []string, sep string) string @param s []string 字符串切片 @param sep string 拼接字符 @return string 合并后的字符串
func JoinAny ¶
JoinAny 将切片合并为字符串 JoinAny[T any](s []T, sep string, typ joinAnyType) string @param s []string 字符串切片 @param sep string 拼接字符 @param typs ...joinAnyStruct 结构体格式化可选类型:默认仅输出值、JoinAnyStructKV输出字段和值、JoinAnyStructAll输出完整结构体 @return string 合并后的字符串
func JoinVal ¶
JoinVal 将切片合并为字符串 JoinVal[T bztype.Numeric | bool](s []T, sep string) string @param s []string 数值或布尔值切片 @param sep string 拼接字符 @return string 合并后的字符串
func Repeat ¶
Repeat 得到指定字符重复n次的字符串 Repeat(s string, repeatTimes int) string @param s string 字符串 @param repeatTimes int 重复次数 @return string 结果字符串
func ReplaceAllWithBraceByMap ¶
ReplaceAllWithBraceByMap 花括号解析
func ReplaceAllWithSquareBraceByMap ¶
ReplaceAllWithSquareBraceByMap 方括号解析
func Split ¶
Split 切分字符串 Split(s string, sep string) []string @param s string 字符串 @param sep string 分割字符 @return []string 切分后的字符串切片
func SplitN ¶
SplitN 切分字符串为N份 SplitN(s string, sep string) []string @param s string 字符串 @param sep string 分割字符 @param n int 切片结果的数量 @return []string 切分后的字符串切片
func SplitRetain ¶
SplitRetain 切分字符串并保留分割字符 SplitRetain(s string, sep string) []string @param s string 字符串 @param sep string 分割字符 @return []string 切分后的字符串切片
func SplitRetainN ¶
SplitRetainN 切分字符串为N份并保留分割字符 SplitRetainN(s string, sep string) []string @param s string 字符串 @param sep string 分割字符 @param n int 切片结果的数量 @return []string 切分后的字符串切片
func ToByte ¶
ToByte 字符串转[]byte ToByte(s string) []byte @param s string 字符串 @return []byte 转换的[]byte结果
func ToFloat ¶
ToFloat 字符串转float ToFloat(s string) (float64, error) @param s string 字符串 @return float64 转换的float结果 @return error 错误信息
func ToInt ¶
ToInt 字符串转int ToInt(s string) (int64, error) @param s string 字符串 @return int64 转换的int结果 @return error 错误信息
func ToLowerFirst ¶
ToLowerFirst 将字符串首字符转为小写 ToLowerFirst(s string) string @param s string 字符串 @return string 首字符小写字符串结果
func ToUpperFirst ¶
ToUpperFirst 将字符串首字符转为大写 ToUpperFirst(s string) string @param s string 字符串 @return string 首字符大写字符串结果
func ToUpperWords ¶
ToUpperWords 将字符串每个单词首字符转为大写 ToUpper(s string) string @param s string 字符串 @return string 字符串结果
func Utf8Encode ¶
Types ¶
This section is empty.