Documentation
¶
Overview ¶
Package xstrings provides functionality for working with strings.
Index ¶
- Constants
- func Slugify(s string, options ...TransformOption) string
- func ToCamelCase(s string) string
- func ToDelimited(s string, delimiter string) string
- func ToDotCase(s string) string
- func ToKebabCase(s string) string
- func ToPascalCase(s string) string
- func ToSnakeCase(s string) string
- type TransformOption
- type TransformOptions
Constants ¶
View Source
const DefaultDelimiter = "-"
Variables ¶
This section is empty.
Functions ¶
func Slugify ¶
func Slugify(s string, options ...TransformOption) string
Slugify converts a string to a slug. By default, it converts the string to lowercase, transliterates it, and removes camel case.
func ToDelimited ¶
ToDelimited converts a string to a delimited format using the specified delimiter
func ToPascalCase ¶
ToPascalCase converts a string to pascal case.
Types ¶
type TransformOption ¶
type TransformOption func(*TransformOptions)
func WithDecamelize ¶
func WithDecamelize(decamelize bool) TransformOption
WithDecamelize sets the decamelize option.
func WithDelimiter ¶
func WithDelimiter(delimiter string) TransformOption
WithDelimiter sets the delimiter option.
func WithLowercase ¶
func WithLowercase(lowercase bool) TransformOption
WithLowercase sets the lowercase option.
func WithTransliterate ¶
func WithTransliterate(transliterate bool) TransformOption
WithTransliterate sets the transliterate option.
type TransformOptions ¶
type TransformOptions struct {
// contains filtered or unexported fields
}
TransformOptions represents the options for transforming a string.
Directories
¶
Path | Synopsis |
---|---|
Package transliterate provides functionality to convert Unicode text into plain ASCII equivalents.
|
Package transliterate provides functionality to convert Unicode text into plain ASCII equivalents. |
internal/table
Package table contains the generated transliteration data for the transliterate package.
|
Package table contains the generated transliteration data for the transliterate package. |
Click to show internal directories.
Click to hide internal directories.