xstring

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesToString

func BytesToString(b []byte) string

BytesToString converts byte slice to string without a memory allocation.

func GenerateUUID added in v1.3.0

func GenerateUUID() string

GenerateUUID creates a new random UUID4 and returns it as a string or panics.

func GetLocaleLng

func GetLocaleLng(lng string) string

get locale language

func RandomString

func RandomString(length int) string

generate random string by len

func Reverse added in v1.3.0

func Reverse(s string) string

Reverse reverses s.

func StringToBytes

func StringToBytes(s string) (b []byte)

StringToBytes converts string to byte slice without a memory allocation.

func StripContentType

func StripContentType(contentType string) string

strip content-type application/json;charset=utf-8

func Substr added in v1.3.0

func Substr(str string, start, stop int) string

Substr returns runes between start and stop [start, stop) regardless of the chars are ascii or utf8. if start < 0 or start < length, it returns empty string if stop < 0 or stop > length, it returns rs[start:], otherwise it returns rs[start:stop]

Types

This section is empty.

Jump to

Keyboard shortcuts

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