Documentation
¶
Overview ¶
Package strings provides utility functions for string manipulation and processing.
This package offers a collection of helper functions for common string operations including transformations, validations, and conversions that complement the standard library's strings package.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ToSnake converts a string to snake_case format. ToSnake = strcase.ToSnake // ToSnakeWithIgnore converts a string to snake_case format, ignoring specific characters. ToSnakeWithIgnore = strcase.ToSnakeWithIgnore // ToScreamingSnake converts a string to SCREAMING_SNAKE_CASE format. ToScreamingSnake = strcase.ToScreamingSnake // ToKebab converts a string to kebab-case format. ToKebab = strcase.ToKebab // ToScreamingKebab converts a string to SCREAMING-KEBAB-CASE format. ToScreamingKebab = strcase.ToScreamingKebab // ToDelimited converts a string to a custom delimiter-separated format. ToDelimited = strcase.ToDelimited // ToScreamingDelimited converts a string to SCREAMING custom delimiter-separated format. ToScreamingDelimited = strcase.ToScreamingDelimited // ToCamel converts a string to CamelCase format. ToCamel = strcase.ToCamel // ToLowerCamel converts a string to lowerCamelCase format. ToLowerCamel = strcase.ToLowerCamel )
Functions ¶
func PadLeft ¶ added in v0.2.0
PadLeft prepends spaces to the left of the input string s until it reaches the specified rune length n.
Example ¶
package main
import (
"fmt"
"github.com/foomo/go/strings"
)
func main() {
result := strings.PadLeft("hello", 10)
fmt.Printf("'%s'", result)
}
Output: ' hello'
func PadRight ¶ added in v0.2.0
PadRight appends spaces to the right of the input string s until it reaches the specified rune length n.
Example ¶
package main
import (
"fmt"
"github.com/foomo/go/strings"
)
func main() {
result := strings.PadRight("hello", 10)
fmt.Printf("'%s'", result)
}
Output: 'hello '
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.