Documentation ¶
Overview ¶
字符串处理方法
Index ¶
- Constants
- func BToInt(s string) (num int64)
- func Charset(src string, srcCode string, target string) []byte
- func HtmlTrim(src string) string
- func Pad(input string, padLength int, padString string, padType int) string
- func Phone(t string) string
- func Random(l int, arg ...string) string
- func StringBitys2Int(s string) (num int64)
- func ToFloat32(s string) float32
- func ToFloat64(s string) float64
- func ToInt(s string) int
- func ToInt64(s string) int64
- func ToInt8(s string) int8
- func ToTime(date string) *time.Time
- func ToUint(s string) uint
- func ToUint16(s string) uint16
- func ToUint64(s string) uint64
- func ToUint8(s string) uint8
- func UUID() string
Constants ¶
View Source
const ( PAD_LEFT = 1 PAD_RIGHT = 2 )
Variables ¶
This section is empty.
Functions ¶
func Pad ¶
字符串填充到指定长度
input string 原字符串 padLength int 规定补齐后的字符串位数 padString string 自定义填充字符串 padType string 填充类型:PAD_LEFT(向左填充,自动补齐位数), 默认右侧
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.