Documentation ¶
Index ¶
- Variables
- func DecodeBase62String(s string) int64
- func EncodeBase62String(id int64) string
- func FastBytesToString(b []byte) string
- func FastStringToBytes(s string) []byte
- func FindFirstDigit(s string) int
- func FindFirstNonDigit(s string) int
- func FindStringInArray(a []string, x string) int
- func LongestCommonPrefix(s1, s2 string) string
- func ParseBool(s string) bool
- func ParseF32(s string) float32
- func ParseF64(s string) float64
- func ParseI16(s string) int16
- func ParseI32(s string) int32
- func ParseI64(s string) int64
- func ParseI8(s string) int8
- func ParseKVToStruct(env map[string]string, ptr reflect.Value)
- func ParseSepKeyValues(text string, sep1, sep2 string) map[string]string
- func ParseStringAs(typename, value string) interface{}
- func ParseStringToValue(s string, v reflect.Value) bool
- func ParseU16(s string) uint16
- func ParseU32(s string) uint32
- func ParseU64(s string) uint64
- func ParseU8(s string) uint8
- func PrettyBytes(n int64) string
- func RandBytes(length int) []byte
- func RandString(length int) string
- func Reverse(str string) string
- func RuneWidth(r rune) int
- func ToCamelCase(s string) string
- func ToDelimited(s string, del uint8) string
- func ToKebabCase(s string) string
- func ToLowerCamelCase(s string) string
- func ToScreamingDelimited(s string, del uint8, screaming bool) string
- func ToScreamingKebab(s string) string
- func ToScreamingSnake(s string) string
- func ToSnakeCase(s string) string
- func WordCount(str string) int
Constants ¶
This section is empty.
Variables ¶
var UTF8Len = utf8.RuneCountInString
UTF8Len is an alias of utf8.RuneCountInString which returns the number of runes in s. Erroneous and short encodings are treated as single runes of width 1 byte.
Functions ¶
func ParseSepKeyValues ¶
解析字符串为map,格式: "a='x,y',c=z" to {"a":"x,y", "c":"z"}
func RuneWidth ¶
RuneWidth returns character width in monotype font. Multi-byte characters are usually twice the width of single byte characters.
Algorithm comes from `mb_strwidth` in PHP. http://php.net/manual/en/function.mb-strwidth.php
func ToDelimited ¶
ToDelimited converts a string to delimited.snake.case (in this case `del = '.'`)
func ToLowerCamelCase ¶
ToLowerCamel converts a string to lowerCamelCase
func ToScreamingDelimited ¶
ToScreamingDelimited converts a string to SCREAMING.DELIMITED.SNAKE.CASE (in this case `del = '.'; screaming = true`) or delimited.snake.case (in this case `del = '.'; screaming = false`)
func ToScreamingKebab ¶
ToScreamingKebab converts a string to SCREAMING-KEBAB-CASE
func ToScreamingSnake ¶
ToScreamingSnake converts a string to SCREAMING_SNAKE_CASE
Types ¶
This section is empty.