xstrings

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2025 License: MIT Imports: 5 Imported by: 1

Documentation

Overview

Package xstrings provides functionality for working with strings.

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.

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.

Jump to

Keyboard shortcuts

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