package
module
Version:
v0.0.0-...-ec1e4af
Opens a new window with list of versions in this module.
Published: Apr 24, 2021
License: MIT
Opens a new window with license information.
Imports: 3
Opens a new window with list of imports.
Imported by: 5
Opens a new window with list of known importers.
README
¶
text
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
¶
Lower case is just an alias to strings.ToLower
Upper case is just an alias to strings.ToUpper
Camel case (e.g. camelCase)
Pascal case (e.g. PascalCase)
Path case (e.g. path/case)
Plural string (e.g. apples)
Singular string (e.g. apple)
Slim case (e.g. Slimcase)
Slug case (e.g. snake-case)
Snake case (e.g. snake_case)
Space case (e.g. Space case)
Title case (e.g. Title Case)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.