Documentation ¶
Index ¶
- Variables
- func AnchorName(text string) string
- func BracketsIntervals(s string, tokenBegin, tokenEnd rune) (string, bool)
- func BytesFrom(p unsafe.Pointer, n int, c int) (r []byte)
- func BytesGBKToUTF8(s []byte) ([]byte, error)
- func BytesToString(b []byte) string
- func BytesUTF8ToGBK(s []byte) ([]byte, error)
- func Camel(s string) string
- func CamelCase[T ~string](s T) string
- func CamelCaseSlice(elem []string) string
- func CamelToSnake(name string) string
- func ConvertToCamelCase(s string) string
- func ConvertUnicode(s []byte) string
- func Cut(s, sep string) (string, string, bool)
- func CutPart(s, sep string) string
- func CutPartContain(s, sep string) string
- func FormatLen(s string, length int) string
- func GBKToUTF8(s string) (string, error)
- func HasHan(s string) bool
- func HasPrefixes(s string, prefixes []string) bool
- func IndexByte(ptr []byte, index int) unsafe.Pointer
- func IndexChar(src string, index int) unsafe.Pointer
- func IsASCIIDigit(c byte) bool
- func IsASCIILetter(c byte) bool
- func IsASCIILetters(s string) bool
- func IsASCIILower(c byte) bool
- func IsASCIILowers(s string) bool
- func IsASCIIUpper(c byte) bool
- func IsASCIIUppers(s string) bool
- func LowerCase(c byte) byte
- func LowerCaseFirst(t string) string
- func Mem2Str(v []byte) (s string)
- func QuoteToBytes(s string) []byte
- func Rand(length int) string
- func ReplaceBytes(s string, olds []byte, new byte) string
- func ReplaceBytesEmpty(s string, old ...byte) string
- func ReplaceRunes(s string, olds []rune, new rune) string
- func ReplaceRunesEmpty(s string, old ...rune) string
- func ReverseCut(s, sep string) (string, string, bool)
- func ReverseCutPart(s, key string) string
- func Str2Mem(s string) (v []byte)
- func StrFrom(p unsafe.Pointer, n int64) (s string)
- func StrPtr(s string) unsafe.Pointer
- func StringToBytes(s string) []byte
- func ToBytes(s string) []byte
- func ToString(b []byte) string
- func UTF8ToGBK(s string) (string, error)
- func Unquote(s []byte) (t string, ok bool)
- func UpperCase(c byte) byte
- func UpperCaseFirst(t string) string
- type NumLetterSlice
Constants ¶
This section is empty.
Variables ¶
var HanPunctuation = []rune{
'\u3002', '\uff1b', '\uff0c', '\uff1a', '\u201c', '\u201d', '\uff08', '\uff09', '\u3001', '\uff1f', '\u300a', '\u300b',
}
[。;,:“”()、?《》]
Functions ¶
func AnchorName ¶
Create returns a sanitized anchor name for the given text.
func BracketsIntervals ¶ added in v1.5.11
寻找括号区间 BracketsIntervals 在给定字符串中寻找由特定开始和结束符号包围的区间。 它会返回第一个找到的由tokenBegin和tokenEnd界定的字符串区间, 如果找到了则返回该区间和true,否则返回空字符串和false。
参数: s - 待搜索的字符串。 tokenBegin - 搜索的开始符号。 tokenEnd - 搜索的结束符号。
返回值: 第一个找到的由tokenBegin和tokenEnd界定的字符串区间, 如果找到了则返回该区间和true,否则返回空字符串和false。
func BytesGBKToUTF8 ¶
func BytesToString ¶
func BytesUTF8ToGBK ¶
func CamelCaseSlice ¶
func CamelToSnake ¶
func ConvertToCamelCase ¶
func ConvertUnicode ¶
func CutPart ¶
指定字符截断,返回阶段前的字符串 CutPart("https://wx1.sinaimg.cn/orj360/6ebedee6ly1h566bbzyc6j20n00cuabd.jpg", "wx1") https://
func CutPartContain ¶
指定字符截断,返回阶段前加指定字符的字符串 CutPartContain("https://f.video.weibocdn.com/o0/F9Nmm1ZJlx080UxqxlJK010412004rJS0E010.mp4?label=mp4_hd&template=540x960.24.0&ori=0&ps=1CwnkDw1GXwCQx&Expires=1670569613&ssig=fAQcBh4HGt&KID=unistore,video", "mp4") https://f.video.weibocdn.com/o0/F9Nmm1ZJlx080UxqxlJK010412004rJS0E010.mp4
func IsASCIILetter ¶
func IsASCIILetters ¶
func IsASCIILowers ¶
func IsASCIIUpper ¶
func IsASCIIUppers ¶
func QuoteToBytes ¶
func ReplaceRunesEmpty ¶
func ReverseCutPart ¶
从字符串尾开始,返回指定字符截断后的字符串 ReverseCutPart("https://video.weibo.com/media/play?livephoto=https%3A%2F%2Flivephoto.us.sinaimg.cn%2F002OnXdGgx07YpcajtkH0f0f0100gv8Q0k01.mov", "%2F") 002OnXdGgx07YpcajtkH0f0f0100gv8Q0k01.mov
func StringToBytes ¶
func Unquote ¶
unquote converts a quoted JSON string literal s into an actual string t. The rules are different than for Go, so cannot use strconv.Unquote.
func UpperCaseFirst ¶
Types ¶
type NumLetterSlice ¶
type NumLetterSlice[T any] ['z' - '0' + 1]T