Skip to content

lawrsp/stringstyles

Repository files navigation

stringstyles

install

  go get -u "github/lawrsp/stringstyles"

Usage

CamelCase

import "github.com/lawrsp/stringstyles"

input := "the_quick_brown_fox_jumps_over_the_lazy_dog"
output := stringstyles.CamelCase(input)

// got:
// theQuickBrownFoxJumpsOverTheLazyDog

SnakeCase

import "github.com/lawrsp/stringstyles"

input := "TheQuickBrownFoxJumpsOverTheLazyDog"
output := stringstyles.SnakeCase(input)

// got:
// the_quick_brown_fox_jumps_over_the_lazy_dog

KebabCase

import "github.com/lawrsp/stringstyles"

input := "TheQuickBrownFoxJumpsOverTheLazyDog"
output := stringstyles.SnakeCase(input)

// got:
// the-quick-brown-fox-jumps-over-the-lazy-dog

StudlyCaps

import "github.com/lawrsp/stringstyles"

input := "TheQuickBrownFoxJumpsOverTheLazyDog"
random := 31283726224234348
output := stringstyles.StudlyCaps(input, random)

// got:
// ThEquICkbROwNFoXJumPSOVErTHElazyDOg

About

convert string styles with golang

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages