strutil

package
v0.0.0-...-3f61646 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2019 License: Apache-2.0 Imports: 28 Imported by: 1

Documentation

Index

Constants

View Source
const (
	UriRegexRule         = `(https?|ftp|file)://[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]`
	DisplayNameRegexRule = `^[-\w|\p{Han}]+$`
)
View Source
const (
	BrChar = `
`
)

Variables

Functions

func ArrToString

func ArrToString(arr []string) string

func AsciiPinyin

func AsciiPinyin(s string) string

func AsciiPinyinLower

func AsciiPinyinLower(s string) string

func BrToMarkdown

func BrToMarkdown(con string) string

func CompileUris

func CompileUris(str string) []string

func ContentHasBase64Image

func ContentHasBase64Image(con string) bool

func DecodeCsvArg

func DecodeCsvArg(s string) []string

func DecodePercent

func DecodePercent(s string) string

func Diff

func Diff(arr1 []string, arr2 []string) []string

func FilteredSQLInject

func FilteredSQLInject(to_match_str string) bool

正则过滤sql注入的方法 参数 : 要匹配的语句

func FromBool

func FromBool(b bool) string

func FromByte

func FromByte(val byte) string

func FromChinese

func FromChinese(str string) string

func FromFloat64

func FromFloat64(i float64) string

func FromInt

func FromInt(val int) string

func FromInt64

func FromInt64(i int64) string

func FromObject

func FromObject(obj interface{}) string

func FromStrList

func FromStrList(strs []string) string

func FromUInt64

func FromUInt64(i uint64) string

func GbkLen

func GbkLen(s string) int

func GenContent

func GenContent(content string, length int) string

func HMacMd5Sign

func HMacMd5Sign(key string, str string) string

func Html2

func Html2(s *goquery.Selection) (ret string, e error)

func HtmlToMarkDownHtml

func HtmlToMarkDownHtml(con string) string

func IsEmail

func IsEmail(str string) bool

func IsEmpty

func IsEmpty(str string) bool

func IsInvalidDisplayName

func IsInvalidDisplayName(displayName string) bool

func IsMobile

func IsMobile(str string) bool

func MarkdownToHtml

func MarkdownToHtml(con string) string

func Md5

func Md5(str string) string

func Md5Object

func Md5Object(obj interface{}) string

func ProcessMobile

func ProcessMobile(mobile string) string

func RandomString

func RandomString(length int) string

func RemoveEmptyPTag

func RemoveEmptyPTag(s string) string

func RemoveHtmlTag

func RemoveHtmlTag(s string) (output string)

HTML strips html tags, replace common entities, and escapes <>&;'" in the result. Note the returned text may contain entities as it is escaped by HTMLEscapeString, and most entities are not translated.

func RemoveHtmlTagExceptBlank

func RemoveHtmlTagExceptBlank(s string) (output string)

func RemoveMarkdownTag

func RemoveMarkdownTag(s string) string

Strip returns the given string sans any Markdown.

func RemoveSpecialCharacters

func RemoveSpecialCharacters(s string) string

func RemoveStylesOfHtmlTag

func RemoveStylesOfHtmlTag(html string, keptStyles ...string) string

func StrArrToInt64Arr

func StrArrToInt64Arr(strs []string) []int64

func StrInArray

func StrInArray(str string, strs []string) bool

func Sub

func Sub(str string, begin, length int) string

func ToBool

func ToBool(s string) bool

func ToByte

func ToByte(str string) byte

func ToFloat64

func ToFloat64(str string) float64

func ToInt

func ToInt(str string) int

func ToInt32

func ToInt32(str string) int32

func ToInt64

func ToInt64(str string) int64

func ToInt64Arr

func ToInt64Arr(str string) []int64

* 字符串中ID以,分割的ids

func ToLike

func ToLike(str string) string

func ToObject

func ToObject(obj interface{}, str string)

func ToSqlNullString

func ToSqlNullString(key string, isNull bool) sql.NullString

func ToStrList

func ToStrList(str string) []string

func ToStringArr

func ToStringArr(str string) []string

* 字符串中ID以,分割的ids

func TrimSpace

func TrimSpace(str string) string

func UUID

func UUID() string

Types

This section is empty.

Jump to

Keyboard shortcuts

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