stringx

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLine

func GetLine(in string, n int) string

GetLine 获取指定行字符串 gets the nth line \n-denoted line from a string.

func IsInArray

func IsInArray(a []string, s string) bool

IsInArray 判断字符串是否在数组中

func IsLowerChar

func IsLowerChar(b byte) bool

IsLowerChar 判断给定字符是否小写

func IsNumeric

func IsNumeric(s string) bool

IsNumeric 判断锁给字符串是否为数字

func IsUpperChar

func IsUpperChar(b byte) bool

IsUpperChar 判断给定字符是否大写

func Left

func Left(s string, n int, ellipsis ...string) string

Left 返回左起n个字符,如果指定第三个参数,则使用其值作为省略符号,否则为"…"

func LowerFirst

func LowerFirst(s string) string

LowerFirst 字符串首字母转换为小写

func RemoveUnprintable

func RemoveUnprintable(s string) string

RemoveUnprintable 删除字符串中不可打印字符 (0 to 31 ASCII)

func Replace

func Replace(origin string, search string, replace string) string

Replace 字符串替换

func ReplaceByMap

func ReplaceByMap(origin string, replaces map[string]string) string

ReplaceByMap 使用map进行字符串替换

func SearchArray

func SearchArray(a []string, s string) int

SearchArray 数组查找字符串索引位置,如果不存在则返回-1,使用完整遍历查找

func Text

func Text(v interface{}) string

Text 文本方法,如枚举文本,只要实现Text()方法即可

func UpperFirst

func UpperFirst(s string) string

UpperFirst 字符串首字母转换为大写

Types

This section is empty.

Jump to

Keyboard shortcuts

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