text

package module
v0.0.0-...-ec1e4af Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2021 License: MIT Imports: 3 Imported by: 5

README

text

GoDoc

Text utilities for Go. Particularly useful for writing code generators.

Install

go get -u github.com/matthewmueller/text

API

Method From To Description
text.Space(str) hi - world hi world space case
text.Lower(str) TEST test lowercase
text.Upper(str) test TEST uppercase
text.Title(str) test Test Title Case
text.Camel(str) Test String testString camelCase
text.Pascal(str) test string TestString PascalCase
text.Snake(str) Test String Test_String snake_case
text.Slug(str) TestString1_2_3 Test-String1-2-3 slug-case
text.Title(str) TestString1_2_3 Test-String1-2-3 slug-case
text.Dot(str) Test String Test.String dot.case
text.Short(str) Test String TS sc (short case)
text.Slim(str) My-Entrée MyEntrées slimcase
text.Singular(str) My-Entrées My-Entrée singular
text.Plural(str) My-Entrée My-Entrées plurals

Need another utility? Open a pull request!

Thanks

Authors

Documentation

Index

Constants

This section is empty.

Variables

Lower case is just an alias to strings.ToLower

Upper case is just an alias to strings.ToUpper

Functions

func Camel

func Camel(s string) string

Camel case (e.g. camelCase)

func Dot

func Dot(s string) string

Dot case (e.g. dot.case)

func Pascal

func Pascal(s string) string

Pascal case (e.g. PascalCase)

func Path

func Path(s string) string

Path case (e.g. path/case)

func Plural

func Plural(s string) string

Plural string (e.g. apples)

func Short

func Short(s string) string

Short case (e.g. sc)

func Singular

func Singular(s string) string

Singular string (e.g. apple)

func Slim

func Slim(s string) string

Slim case (e.g. Slimcase)

func Slug

func Slug(s string) string

Slug case (e.g. snake-case)

func Snake

func Snake(s string) string

Snake case (e.g. snake_case)

func Space

func Space(s string) string

Space case (e.g. Space case)

func Title

func Title(s string) string

Title case (e.g. Title Case)

Types

This section is empty.

Jump to

Keyboard shortcuts

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