text

package
v1.18.0 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CharCount

func CharCount(str string) int

CharCount counts characters in a string (excluding spaces)

func ContainsAny

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

ContainsAny checks if string contains any of the substrings

func EndsWithAny

func EndsWithAny(str string, suffixes ...string) bool

EndsWithAny checks if string ends with any of the suffixes

func ExtractEmails

func ExtractEmails(str string) []string

ExtractEmails extracts all email addresses from a string

func ExtractNumbers

func ExtractNumbers(str string) []string

ExtractNumbers extracts all numbers from a string

func ExtractURLs

func ExtractURLs(str string) []string

ExtractURLs extracts all URLs from a string

func IsEmpty

func IsEmpty(str string) bool

IsEmpty checks if string is empty or contains only whitespace

func LevenshteinDistance

func LevenshteinDistance(a, b string) int

LevenshteinDistance calculates the Levenshtein distance between two strings

func Mask

func Mask(str string, start, end int) string

Mask masks part of a string with asterisks

func MaskEmail

func MaskEmail(email string) string

MaskEmail masks email address (keeps first and last char of username)

func Normalize

func Normalize(input string) string

Normalize converts string to lowercase and trims whitespace

func Pad

func Pad(str string, length int, padChar rune, leftPad bool) string

Pad pads string to specified length with given character

func PadLeft

func PadLeft(str string, length int, padChar rune) string

PadLeft pads string on the left to specified length

func PadRight

func PadRight(str string, length int, padChar rune) string

PadRight pads string on the right to specified length

func RemoveAccents

func RemoveAccents(str string) string

RemoveAccents removes accents from characters

func Reverse

func Reverse(str string) string

Reverse reverses a string

func StartsWithAny

func StartsWithAny(str string, prefixes ...string) bool

StartsWithAny checks if string starts with any of the prefixes

func ToCamelCase

func ToCamelCase(str string) string

ToCamelCase converts string to camelCase

func ToKebabCase

func ToKebabCase(str string) string

ToKebabCase converts string to kebab-case

func ToPascalCase

func ToPascalCase(str string) string

ToPascalCase converts string to PascalCase

func ToSlug

func ToSlug(str string) string

ToSlug converts string to URL-friendly slug

func ToSnakeCase

func ToSnakeCase(str string) string

ToSnakeCase converts string to snake_case

func Truncate

func Truncate(str string, length int) string

Truncate truncates a string to the specified length

func TruncateWithEllipsis

func TruncateWithEllipsis(str string, length int) string

TruncateWithEllipsis truncates a string and adds ellipsis

func WordCount

func WordCount(str string) int

WordCount counts words in a string

Types

This section is empty.

Jump to

Keyboard shortcuts

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