Documentation
¶
Overview ¶
Package strings extends the functionality of the standard strings library
Index ¶
- func Capitalize(s string) string
- func ContainsAll(s string, substrings ...string) bool
- func ContainsAny(s string, substrings ...string) bool
- func DefaultIfBlank(s string, defaultValue string) string
- func DefaultIfEmpty(s string, defaultValue string) string
- func IsAlpha(s string) bool
- func IsAlphanumeric(s string) bool
- func IsBlank(s string) bool
- func IsEmpty(s string) bool
- func IsNumeric(s string) bool
- func LeftPad(s string, width int, char rune) string
- func Reverse(s string) string
- func RightPad(s string, width int, char rune) string
- func SwapCase(s string) string
- func TruncateWithSuffix(s string, maxLength int, suffix string) string
- func Uncapitalize(s string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Capitalize ¶
Capitalize returns the string with the first character converted to uppercase
func ContainsAll ¶
ContainsAll returns true if the string contains all of the specified substrings
func ContainsAny ¶
ContainsAny returns true if the string contains any of the specified substrings
func DefaultIfBlank ¶
DefaultIfBlank returns the default value if the string is blank
func DefaultIfEmpty ¶
DefaultIfEmpty returns the default value if the string is empty
func IsAlphanumeric ¶
IsAlphanumeric returns true if the string contains only Unicode letters or digits
func TruncateWithSuffix ¶
TruncateWithSuffix truncates a string to the specified length and appends the suffix
func Uncapitalize ¶
Uncapitalize returns the string with the first character converted to lowercase
Types ¶
This section is empty.