inflector

package
v0.35.0 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2025 License: MIT Imports: 5 Imported by: 190

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Camelize added in v0.25.0

func Camelize(str string) string

Camelize converts the provided string to its "CamelCased" version (non alphanumeric characters are removed).

For example:

inflector.Camelize("send_email") // "SendEmail"

func Columnify

func Columnify(str string) string

Columnify strips invalid db identifier characters.

func Sanitize

func Sanitize(str string, removePattern string) (string, error)

Sanitize sanitizes `str` by removing all characters satisfying `removePattern`. Returns an error if the pattern is not valid regex string.

func Sentenize

func Sentenize(str string) string

Sentenize converts and normalizes string into a sentence.

func Singularize added in v0.25.0

func Singularize(word string) string

Singularize converts the specified word into its singular version.

For example:

inflector.Singularize("people") // "person"

func Snakecase

func Snakecase(str string) string

Snakecase removes all non word characters and converts any english text into a snakecase. "ABBREVIATIONS" are preserved, eg. "myTestDB" will become "my_test_db".

func UcFirst

func UcFirst(str string) string

UcFirst converts the first character of a string into uppercase.

Types

This section is empty.

Jump to

Keyboard shortcuts

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