strutil

package
v0.17.3 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CmpFoldFast added in v0.17.2

func CmpFoldFast(s1, s2 string) bool

CmpFoldFast compares two strings in a case-insensitive manner. Works significantly faster than CmpFoldSafe, especially on longer strings

func CmpFoldSafe added in v0.17.2

func CmpFoldSafe(s1, s2 string) bool

CmpFoldSafe compares two strings in a case-insensitive manner without relying on bitwise lowercasing.

func CutHeader

func CutHeader(header string) (value, params string)

func CutParams

func CutParams(header string) (params string)

CutParams behaves exactly as strings.Cut, but strips whitespaces between value and the first-encountered parameter in addition.

func IsASCIINonprintable added in v0.17.3

func IsASCIINonprintable(c byte) bool

func IsURLUnsafeChar added in v0.17.3

func IsURLUnsafeChar(c byte) bool

IsURLUnsafeChar tells whether it's safe to decode an urlencoded character.

func LStripWS

func LStripWS(str string) string

func NormalizeAddress

func NormalizeAddress(addr string) string

func ParseQualifier added in v0.17.3

func ParseQualifier(q string) int

ParseQualifier returns an int in range [0, 10] representing the qualifier value. All values below the 0.1 resolution are ignored. Invalid values result in 0. But keep in mind that 0 is also a valid value.

func URLDecode added in v0.17.3

func URLDecode(str string) (string, bool)

URLDecode decodes an urlencoded string and tells whether the string was properly formed.

func Unquote

func Unquote(str string) string

func WalkKV

func WalkKV(data string) iter.Seq2[string, string]

Types

This section is empty.

Jump to

Keyboard shortcuts

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