strlib

package
v1.0.17 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultTrimChars = string([]byte{
	'\t',
	'\v',
	'\n',
	'\r',
	'\f',
	' ',
	0x00,
	0x85,
	0xA0,
})

DefaultTrimChars are the characters which are stripped by Trim* functions in default.

Functions

func ContainHan

func ContainHan(str string) bool

func LStrip

func LStrip(str string, characterMask ...string) string

LStrip strips whitespace (or other characters) from the beginning and end of a string. The optional parameter `characterMask` specifies the additional stripped characters.

func NonceStr

func NonceStr() string

func RStrip

func RStrip(str string, characterMask ...string) string

RStrip RTrim strips whitespace (or other characters) from the beginning and end of a string. The optional parameter `characterMask` specifies the additional stripped characters.

func Reverse

func Reverse(s string) string

Reverse returns string whose char order is reversed to the given string.

func StringOrEmpty

func StringOrEmpty(s *string) string

func Strip

func Strip(str string, characterMask ...string) string

Strip strips whitespace (or other characters) from the beginning and end of a string. The optional parameter `characterMask` specifies the additional stripped characters.

func ToBool

func ToBool(s string, fn ...func(s string) bool) bool

func ToFloat

func ToFloat[T constraints.Float](s string, missing T) T

func ToInteger

func ToInteger[T constraints.Integer](s string, missing T) T

func Trim

func Trim(str string, characterMask ...string) string

Trim strips whitespace (or other characters) from the beginning and end of a string. The optional parameter `characterMask` specifies the additional stripped characters.

Types

This section is empty.

Jump to

Keyboard shortcuts

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