jgstr

package module
v0.9.5 Latest Latest
Warning

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

Go to latest
Published: May 9, 2023 License: MIT Imports: 12 Imported by: 0

README

字符串相关的函数

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CamelToSnake

func CamelToSnake(s string) string

convert CamelCase to camel_case

func CombineSortedWithSep

func CombineSortedWithSep(sep string, strs []string) string

CombineSortedWithSep combines a slice of strings into a single string, with the given separator between each string. The strings are sorted.

func CompareStringPointer added in v0.9.5

func CompareStringPointer(a, b *string) bool

CompareStringPointer compare string pointer return true if a and b are both nil or a == b

func FloatVal

func FloatVal(s string) float64

func FormatGo

func FormatGo(src []byte) ([]byte, error)

格式化golang代码,包括import

func GetStringByPointer added in v0.9.5

func GetStringByPointer(pointer *string) string

GetStringByPointer get string by pointer return "" if pointer is nil

func IntVal

func IntVal(s string) int64

func JsonEncode

func JsonEncode(v interface{}) string

encode json

func Lcfirst

func Lcfirst(s string) string

convert first letter to lower case

func MD5

func MD5(str string) string

func RandStr added in v0.9.4

func RandStr(n int) string

Reference: https://xie.infoq.cn/article/f274571178f1bbe6ff8d974f3

func Ucfirst

func Ucfirst(s string) string

convert first letter to upper case

func UintVal

func UintVal(s string) uint64

Types

This section is empty.

Jump to

Keyboard shortcuts

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