strx

package
v1.5.4 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HasPrefixAny

func HasPrefixAny(s string, prefixes ...string) bool

HasPrefixAny returns true if s has any of the given prefixes.

func HasSuffixAny

func HasSuffixAny(s string, suffixes ...string) bool

HasSuffixAny returns true if s has any of the given suffixes.

func SplitAndTrim

func SplitAndTrim(s, sep string) []string

SplitAndTrim splits by sep, trims items, and removes empty parts.

func TrimSpaceAndCompress

func TrimSpaceAndCompress(s string) string

TrimSpaceAndCompress trims leading/trailing spaces and compresses internal whitespace to single spaces.

func Truncate

func Truncate(s string, max int, ellipsis string) string

Truncate cuts the string in a rune-safe way; max<=0 returns an empty string. If ellipsis is provided and truncation occurs, append it to the end.

Types

This section is empty.

Jump to

Keyboard shortcuts

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