strcase

package
v0.3.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2019 License: BSD-3-Clause, MIT Imports: 2 Imported by: 0

README

strcase

Godoc Reference Build Status Coverage

strcase is a go package for converting string case to snake case or camel case.

Example

s := "AnyKind of_string"
Function Result
ToSnake(s) any_kind_of_string
ToScreamingSnake(s) ANY_KIND_OF_STRING
ToKebab(s) any-kind-of-string
ToScreamingKebab(s) ANY-KIND-OF-STRING
ToDelimited(s, '.') any.kind.of.string
ToScreamingDelimited(s, '.') ANY.KIND.OF.STRING
ToCamel(s) AnyKindOfString
ToLowerCamel(s) anyKindOfString

Documentation

Overview

Package strcase converts strings to snake_case or CamelCase

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToCamel

func ToCamel(s string) string

Converts a string to CamelCase

func ToDelimited

func ToDelimited(s string, del uint8) string

Converts a string to delimited.snake.case (in this case `del = '.'`)

func ToKebab

func ToKebab(s string) string

Converts a string to kebab-case

func ToLowerCamel

func ToLowerCamel(s string) string

Converts a string to lowerCamelCase

func ToScreamingDelimited

func ToScreamingDelimited(s string, del uint8, screaming bool) string

Converts a string to SCREAMING.DELIMITED.SNAKE.CASE (in this case `del = '.'; screaming = true`) or delimited.snake.case (in this case `del = '.'; screaming = false`)

func ToScreamingKebab

func ToScreamingKebab(s string) string

Converts a string to SCREAMING-KEBAB-CASE

func ToScreamingSnake

func ToScreamingSnake(s string) string

Converts a string to SCREAMING_SNAKE_CASE

func ToSnake

func ToSnake(s string) string

Converts a string to snake_case

Types

This section is empty.

Jump to

Keyboard shortcuts

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