stringsx

package
v1.0.75 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2026 License: MIT Imports: 9 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainsAny

func ContainsAny(str string, matches ...string) (string, bool)

ContainsAny returns the first string from matches that is contained in str, and true (empty string and false otherwise)

func FromBytes

func FromBytes(b []byte) string

FromBytes Converts a byte array to a string (without copying the data)

func IsAsciiSpace

func IsAsciiSpace(c byte) bool

IsAsciiSpace returns true if the given byte represents and ASCII code for whitespace, false otherwise

func IsBlank

func IsBlank(value string) bool

IsBlank Checks if the string is empty or whitespace

func IsBlankPtr

func IsBlankPtr(ptr *string) bool

IsBlankPtr Checks if the string pointer IS nil, empty, or whitespace

func IsNotBlank

func IsNotBlank(value string) bool

IsNotBlank Checks if the string is NOT empty or whitespace

func IsNotBlankPtr

func IsNotBlankPtr(ptr *string) bool

IsNotBlankPtr Checks if the string pointer is NOT nil, empty, or whitespace

func Join

func Join(separator string, filter func(str string) bool, strs ...string) string

Join filters and joins strings

func JoinNonBlank

func JoinNonBlank(separator string, strs ...string) string

JoinNonBlank joins non-blank strings

func NormalizeSymbols

func NormalizeSymbols(value string) string

func NormalizeSymbolsPtr

func NormalizeSymbolsPtr(value *string)

NormalizeSymbolsPtr - Replaces all abnormal quotes characters with the ASCII version '"' (input is a pointer to string)

func Remove

func Remove(value string, rxp *regexp.Regexp) string

Remove removes from the string all matches of the given regex

func ToBytes

func ToBytes(s string) []byte

ToBytes Converts a string to a byte array (without copying the data)

func ToTitle

func ToTitle(value string) string

ToTitle transforms the given string into the title counterpart ("this is a title -> This Is A Title")

func Unquote

func Unquote(s string) string

Unquote removes quotes from the string if it is a correctly quoted string (`"abc"` -> `abc`)

func UpdateIfExists

func UpdateIfExists(ptr *string, value string)

UpdateIfExists Updates the string pointer if the value is not blank

Types

This section is empty.

Jump to

Keyboard shortcuts

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