strutil

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2023 License: MIT Imports: 4 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Camel added in v1.0.1

func Camel(s string) string

Camel string, xx_yy to XxYy

func Reverse

func Reverse(s string) string

Reverse 反转字符串

func Shuffle added in v1.0.4

func Shuffle(s string) string

Shuffle 打乱字符串

func Snake added in v1.0.1

func Snake(s string) string

Snake string, XxYy to xx_yy , XxYY to xx_yy

func ToInt

func ToInt(str string) int

ToInt 字符串转成 int,失败返回0

func ToIntWith

func ToIntWith(str string, defaultValue int) int

ToIntWith 字符串转成 int,失败返回默认值

func ToTime

func ToTime(str string) *time.Time

ToTime 字符串转 time,失败返回 nil

func ToTimeWithLayout

func ToTimeWithLayout(str string, layout string) *time.Time

ToTimeWithLayout 按格式化转成成 time,失败返回 nil

Types

This section is empty.

Jump to

Keyboard shortcuts

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