caseconv

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2025 License: MIT Imports: 2 Imported by: 2

README

strcase

Godoc Reference Go Coverage Go Report Card

caseconv is a go package for converting string case to various cases (e.g. snake case or camel case) to see the full conversion table below.

Example

s := "AnyKind of_string"
Function Result
ToSnake(s) any_kind_of_string
ToSnakeWithIgnore(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, '.', '', true) ANY.KIND.OF.STRING
ToScreamingDelimited(s, '.', ' ', true) ANY.KIND OF.STRING
ToCamel(s) AnyKindOfString
ToLowerCamel(s) anyKindOfString

Install

go get -u github.com/peyton-spencer/caseconv

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Case

type Case uint8
const (
	CaseSnake Case = iota
	CaseSnakeScreaming
	CaseCamel
	CaseKebab
	CaseKebabScreaming
)

func (Case) BytCase added in v0.2.0

func (c Case) BytCase(s []byte) []byte

func (Case) StrCase added in v0.2.0

func (c Case) StrCase(s string) string

Directories

Path Synopsis
Package bytcase converts byte slices to various cases.
Package bytcase converts byte slices to various cases.
Package strcase converts strings to various cases.
Package strcase converts strings to various cases.

Jump to

Keyboard shortcuts

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