string

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

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 ToCamelCase

func ToCamelCase(s string) string

ToCamelCase converts a string to camelCase.

func ToDelimited

func ToDelimited(s string, delimiter string) string

ToDelimited converts a string to a delimited format using the specified delimiter

func ToDotCase

func ToDotCase(s string) string

ToDotCase converts a string to dot case.

func ToKebabCase

func ToKebabCase(s string) string

ToKebabCase converts a string to kebab case.

func ToPascalCase

func ToPascalCase(s string) string

ToPascalCase converts a string to pascal case.

func ToSnakeCase

func ToSnakeCase(s string) string

ToSnakeCase converts a string to snake case.

func Transliterate

func Transliterate(s string) string

Transliterate converts a string to its transliterated form.

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.

Jump to

Keyboard shortcuts

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