stringutil

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

* Copyright 2020-2021 the original author(https://github.com/wj596) * * <p> * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * </p>

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Camel2Case

func Camel2Case(name string) string

驼峰式写法转为下划线写法

func Case2Camel

func Case2Camel(name string) string

下划线写法转为驼峰写法

func CommasToMap

func CommasToMap(base string, sep string) map[string]interface{}

逗号分隔键值对转MAP,类似"name=wangjie,age=20"或者"name=wangjie|age=20"

func HmacMD5

func HmacMD5(plaintext string, key string) string

func HmacSHA256

func HmacSHA256(plaintext string, key string) string

func IsChineseChar

func IsChineseChar(str string) bool

是否为中文

func IsEmailFormat

func IsEmailFormat(email string) bool

是否为邮件格式

func Lcfirst

func Lcfirst(str string) string

首字母小写

func MD5

func MD5(str string) string

MD5编码

func MapToQueryString

func MapToQueryString(base string, parameters map[string]interface{}) string

map转查询字符串

func ToFloat64Safe

func ToFloat64Safe(str string) float64

func ToInt64Safe

func ToInt64Safe(str string) int64

转换为Uint64

func ToIntSafe

func ToIntSafe(str string) int

转换为Int

func ToJsonBytes

func ToJsonBytes(v interface{}) []byte

func ToJsonIndent

func ToJsonIndent(v interface{}) string

func ToJsonString

func ToJsonString(v interface{}) string

func ToString

func ToString(value interface{}) string

转换为字符串

func ToUint32

func ToUint32(str string) (uint32, error)

func ToUint32Safe

func ToUint32Safe(str string) uint32

func ToUint64Safe

func ToUint64Safe(str string) uint64

转换为Uint64

func UUID

func UUID() string

产生UUID

func Ucfirst

func Ucfirst(str string) string

首字母大写

func Uint64ToStr

func Uint64ToStr(u uint64) string

Uint64转换为String

func UrlValuesToQueryString

func UrlValuesToQueryString(base string, parameters url.Values) string

url.Values转查询字符串

Types

This section is empty.

Jump to

Keyboard shortcuts

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