str

package
v1.1.11 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2019 License: Apache-2.0 Imports: 14 Imported by: 3

Documentation

Overview

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * _ _ * | (_)_ __ __ _ * _ | | | '_ \ / _` | * | |_| | | | | | (_| | * \___/|_|_| |_|\__, | https://github.com/yingzhuo/jing * |___/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * _ _ * | (_)_ __ __ _ * _ | | | '_ \ / _` | * | |_| | | | | | (_| | * \___/|_|_| |_|\__, | https://github.com/yingzhuo/jing * |___/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * _ _ * | (_)_ __ __ _ * _ | | | '_ \ / _` | * | |_| | | | | | (_| | * \___/|_|_| |_|\__, | https://github.com/yingzhuo/jing * |___/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * _ _ * | (_)_ __ __ _ * _ | | | '_ \ / _` | * | |_| | | | | | (_| | * \___/|_|_| |_|\__, | https://github.com/yingzhuo/jing * |___/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * _ _ * | (_)_ __ __ _ * _ | | | '_ \ / _` | * | |_| | | | | | (_| | * \___/|_|_| |_|\__, | https://github.com/yingzhuo/jing * |___/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * _ _ * | (_)_ __ __ _ * _ | | | '_ \ / _` | * | |_| | | | | | (_| | * \___/|_|_| |_|\__, | https://github.com/yingzhuo/jing * |___/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * _ _ * | (_)_ __ __ _ * _ | | | '_ \ / _` | * | |_| | | | | | (_| | * \___/|_|_| |_|\__, | https://github.com/yingzhuo/jing * |___/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * _ _ * | (_)_ __ __ _ * _ | | | '_ \ / _` | * | |_| | | | | | (_| | * \___/|_|_| |_|\__, | https://github.com/yingzhuo/jing * |___/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

Index

Constants

View Source
const (
	EmptyString = ""
)

Variables

This section is empty.

Functions

func AllMatches

func AllMatches(s string, fn func(r rune) bool) bool

func AnyMatches

func AnyMatches(s string, fn func(r rune) bool) bool

func BCrypt

func BCrypt(s string) string

func Base64StdDecode

func Base64StdDecode(s string) string

func Base64StdEncode

func Base64StdEncode(s string) string

func Base64URLDecode

func Base64URLDecode(s string) string

func Base64URLEncode

func Base64URLEncode(s string) string

func CheckBCrypt

func CheckBCrypt(raw, hashed string) bool

func CountRune

func CountRune(s string) int

func CountRuneFunc

func CountRuneFunc(s string, fn func(r rune) bool) int

func DefaultIfBlank

func DefaultIfBlank(s string, defaultValue string) string

func DefaultIfEmpty

func DefaultIfEmpty(s string, defaultValue string) string

func IsBlank

func IsBlank(s string) bool

func IsEmpty

func IsEmpty(s string) bool

func IsNotBlank

func IsNotBlank(s string) bool

func IsNotEmpty

func IsNotEmpty(s string) bool

func Length

func Length(s string) int

func MD4

func MD4(s string) string

func MD5

func MD5(s string) string

func NewUUID32

func NewUUID32() string

生成32位UUID

func NewUUID36

func NewUUID36() string

生成36位UUID

func NoneMatches

func NoneMatches(s string, fn func(r rune) bool) bool

func RandAlphabetic

func RandAlphabetic(n int) string

生成随机n位长度英文字母字符串

n: 长度

例子:

RandAlphabetic(10)

func RandAlphanumeric

func RandAlphanumeric(n int) string

生成随机n位长度数字或英文字母字符串

n: 长度

例子:

RandAlphanumeric(10)

func RandNumeric

func RandNumeric(n int) string

生成随机n位长度数字字符串

n: 长度

例子:

RandNumeric(10)

func RandString

func RandString(n int, charset string) string

func Reverse

func Reverse(s string) string

func SHA1

func SHA1(s string) string

func SHA256

func SHA256(s string) string

func SHA384

func SHA384(s string) string

func SHA512

func SHA512(s string) string

func TrimWhitespace

func TrimWhitespace(s string) string

Types

type StringSlice

type StringSlice []string

func NewStringSlice added in v1.1.10

func NewStringSlice() *StringSlice

func (*StringSlice) Add added in v1.1.5

func (ss *StringSlice) Add(value string)

func (*StringSlice) AllMatch

func (ss *StringSlice) AllMatch(fn func(s string) bool) bool

func (*StringSlice) AnyMatch

func (ss *StringSlice) AnyMatch(fn func(s string) bool) bool

func (*StringSlice) Filter

func (ss *StringSlice) Filter(fn func(s string) bool) *StringSlice

func (*StringSlice) IsSorted

func (ss *StringSlice) IsSorted() bool

func (*StringSlice) Len

func (ss *StringSlice) Len() int

func (*StringSlice) Less

func (ss *StringSlice) Less(i, j int) bool

func (*StringSlice) Map

func (ss *StringSlice) Map(fn func(s string) string) *StringSlice

func (*StringSlice) NoneMatch

func (ss *StringSlice) NoneMatch(fn func(s string) bool) bool

func (*StringSlice) NotFilter

func (ss *StringSlice) NotFilter(fn func(s string) bool) *StringSlice

func (*StringSlice) Reverse

func (ss *StringSlice) Reverse()

func (*StringSlice) Set added in v1.1.5

func (ss *StringSlice) Set(value string) error

func (*StringSlice) Sort

func (ss *StringSlice) Sort()

func (*StringSlice) SortReverse

func (ss *StringSlice) SortReverse()

func (*StringSlice) String added in v1.1.5

func (ss *StringSlice) String() string

func (*StringSlice) Swap

func (ss *StringSlice) Swap(i, j int)

func (*StringSlice) TrimEach added in v1.1.10

func (ss *StringSlice) TrimEach() *StringSlice

func (*StringSlice) Unique added in v1.1.9

func (ss *StringSlice) Unique() *StringSlice

Jump to

Keyboard shortcuts

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