xstring

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2022 License: Apache-2.0 Imports: 14 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var OmitDefaultAPI = jsoniter.Config{
	SortMapKeys:            true,
	UseNumber:              true,
	CaseSensitive:          true,
	EscapeHTML:             true,
	ValidateJsonRawMessage: true,
}.Froze()

OmitDefaultAPI ...

Functions

func Addr2Hex

func Addr2Hex(str string) (string, error)

Addr2Hex converts address string to hex string, only support ipv4.

func All added in v0.4.2

func All(ss []string, match func(item string) bool) bool

func Any added in v0.4.2

func Any(ss []string, match func(item string) bool) bool

func AnyBlank

func AnyBlank(ss []string) bool

AnyBlank return true if ss has empty element

func CallerName

func CallerName(skip int) string

CallerName ...

func FunctionName

func FunctionName(i interface{}) string

FunctionName ...

func GenerateID

func GenerateID() string

GenerateID simply generates an ID.

func GenerateUUID

func GenerateUUID(seedTime time.Time) string

GenerateUUID simply generates an unique UID.

func HasString added in v0.4.2

func HasString(ss []string, str string) bool

func Hex2Addr

func Hex2Addr(str string) (string, error)

Hex2Addr converts hex string to address.

func IndexString added in v0.4.2

func IndexString(ss []string, str string) int

func Json

func Json(obj interface{}) string

Json ...

func JsonBytes

func JsonBytes(obj interface{}) []byte

JsonBytes ...

func ObjectName

func ObjectName(i interface{}) string

ObjectName ...

func Pointer added in v0.4.2

func Pointer(str string) *string

func PrettyJSONBytes

func PrettyJSONBytes(obj interface{}) []byte

PrettyJSONBytes ...

func PrettyJson

func PrettyJson(obj interface{}) string

PrettyJson ...

func Reverse added in v0.4.2

func Reverse(s string) string

func ToCamelCase

func ToCamelCase(str string) string

ToCamelCase 转为驼峰格式

func ToSnakeCase

func ToSnakeCase(str string) string

ToSnakeCase 转为snake格式

Types

type Formatter

type Formatter string

Formatter ...

func (Formatter) Format

func (fm Formatter) Format(args ...interface{}) string

Format ...

type Strings

type Strings []string

Strings ...

func Kick added in v0.4.2

func Kick(ss []string, remove func(item string) bool) Strings

func KickEmpty

func KickEmpty(ss []string) Strings

KickEmpty kick empty elements from ss

func Split

func Split(raw string, sep string) Strings

Split ...

func (Strings) Head

func (ss Strings) Head() string

Head ...

func (Strings) Head2

func (ss Strings) Head2() (h0, h1 string)

Head2 ...

func (Strings) Head3

func (ss Strings) Head3() (h0, h1, h2 string)

Head3 ...

func (Strings) Head4

func (ss Strings) Head4() (h0, h1, h2, h3 string)

Head4 ...

func (Strings) HeadT

func (ss Strings) HeadT() (string, Strings)

HeadT ...

Jump to

Keyboard shortcuts

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