funString

package
v0.0.0-...-ed2e16d Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2020 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Addslashes

func Addslashes(str string) string

使用反斜线引用字符串

func Bin2hex

func Bin2hex(str string) string

func Chr

func Chr(ascii int) string

返回指定的字符

func Chunk_split

func Chunk_split(body string, chunklen uint, end string) string

func Explode

func Explode(delimiter, str string) []string

*

  • 不建议外部使用 funString.Explode strings.Split 本身很简单

func Hex2bin

func Hex2bin(str string) string

func Html_entity_decode

func Html_entity_decode(str string) string

func Htmlentities

func Htmlentities(str string) string

将字符转换为 HTML 转义字符

func Implode

func Implode(glue string, pieces []string) string

*

  • 不建议外部使用 funString.Implode strings.Join 本身很简单

func Join

func Join(glue string, pieces []string) string

*

  • Implode别名

func Lcfirst

func Lcfirst(str string) string

func Ltrim

func Ltrim(str string, characterMask ...string) string

*

  • 不建议外部使用 funString.Ltrim strings.TrimLeft 本身很简单

func Md5

func Md5(text string) string

func Md5_file

func Md5_file(filePath string) string

func Nl2br

func Nl2br(str string, isXhtml bool) string

func NumberFormat

func NumberFormat(number float64, decimals uint, decPoint, thousandsSep string) string

func Ord

func Ord(str string) int

返回指定的字符

func ParseStr

func ParseStr(encodedString string, result map[string]interface{}) error

将字符串解析成多个变量

func Rtrim

func Rtrim(str string, characterMask ...string) string

*

  • 不建议外部使用 funString.Rtrim strings.TrimRight 本身很简单

func Sha1

func Sha1(str string) string

func Sha1_file

func Sha1_file(filename string) string

计算文件的 sha1 散列值

func StrRepeat

func StrRepeat(input string, multiplier int) string

func StrReplace

func StrReplace(search, replace, subject string, count int) string

*

  • 不建议外部使用 funString.StrReplace strings.Replace 本身很简单

func StrShuffle

func StrShuffle(str string) string

func Str_word_count

func Str_word_count(str string) []string

返回字符串中单词的使用情况

func Stripos

func Stripos(haystack, needle string, offset int) int

func Stripslashes

func Stripslashes(str string) string

反引用一个使用 addcslashes() 转义的字符串

func Stristr

func Stristr(haystack string, needle string, beforeNeedle bool) string

func Strlen

func Strlen(str string) int

*

  • 不建议外部使用 funString.Strlen len 本身很简单

func Strpos

func Strpos(haystack, needle string, offset int) int

func Strrev

func Strrev(str string) string

func Strripos

func Strripos(haystack, needle string, offset int) int

func Strrpos

func Strrpos(haystack, needle string, offset int) int

func Strstr

func Strstr(haystack string, needle string, beforeNeedle bool) string

func Strtolower

func Strtolower(origin string) string

*

  • 不建议外部使用 funString.Strtolower strings.ToUpper 本身很简单

func Strtoupper

func Strtoupper(origin string) string

*

  • 不建议外部使用 funString.Strtoupper,因为 strings.ToUpper 本身很简单

func Substr

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

func SubstrCount

func SubstrCount(haystack string, needle string) int

func Substr_compare

func Substr_compare(main_str, str string, offset, length int) int

二进制安全比较字符串

func Trim

func Trim(str string, characterMask ...string) string

*

  • 不建议外部使用 funString.Trim strings.Trim 本身很简单

func Ucfirst

func Ucfirst(str string) string

func Ucwords

func Ucwords(str string) string

*

  • 不建议外部使用 funString.Ucwords strings.Title 本身很简单

func Wordwrap

func Wordwrap(str string, width uint, br string) string

打断字符串为指定数量的字串

Types

This section is empty.

Jump to

Keyboard shortcuts

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