xstring

package
v2.6.1 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FirstCharacterIsLower

func FirstCharacterIsLower(s string) bool

FirstCharacterIsLower reports whether the first character of s is a lower-case letter.

func FirstCharacterIsNumber

func FirstCharacterIsNumber(s string) bool

FirstCharacterIsNumber reports whether the first character of s is a digit.

func FirstCharacterIsSymbol

func FirstCharacterIsSymbol(s string) bool

FirstCharacterIsSymbol reports whether the first character of s is a symbol.

func FirstCharacterIsUpper

func FirstCharacterIsUpper(s string) bool

FirstCharacterIsUpper reports whether the first character of s is an upper-case letter.

func Length

func Length(s string) int

Length returns the number of characters (runes) in s rather than its number of bytes.

func PaddingPrefix added in v2.1.0

func PaddingPrefix(s, padding string, length int) string

PaddingPrefix prepends padding to s until the result reaches length characters. Lengths are counted in runes. It returns s unchanged when s already has at least length characters or when padding is empty.

func PaddingSuffix added in v2.1.0

func PaddingSuffix(s, padding string, length int) string

PaddingSuffix appends padding to s until the result reaches length characters. Lengths are counted in runes. It returns s unchanged when s already has at least length characters or when padding is empty.

func Replace added in v2.4.0

func Replace(str string, start, count int, replace string) string

Replace replaces count characters of str with replace repeated count times, starting at the character index start (0-based). A negative count means replacing through the end of the string. It returns str unchanged when start is out of range.

Types

This section is empty.

Jump to

Keyboard shortcuts

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