github.com/pinzolo/casee

Golang liibrary for case convertion of string.


License
MIT
Install
go get github.com/pinzolo/casee

Documentation

casee

Test Coverage Status Go Report Card Godoc license

Golang liibrary for case convertion of string.

Usage

  1. go get -d github.com/pinzolo/casee.
  2. Add github.com/pinzolo/casee to import section in your go file.

Functions

Convert functions

  • ToSnakeCase
    Convert to snake_case style string.
  • ToChainCase
    Convert to chain-case style string.
  • ToCamelCase
    Convert to camelCase style string.
  • ToPascalCase
    Convert to PascalCase style string.
  • ToFlatCase
    Convert to flatcase style string.
  • ToUpperCase
    Convert to UPPER_CASE style string.

Check functions

  • IsSnakeCase
    Check argument string is snake_case.
  • IsChainCase
    Check argument string is chain-case.
  • IsCamelCase
    Check argument string is camelCase.
  • IsPascalCase
    Check argument string is PascalCase.
  • IsFlatCase
    Check argument string is flatcase.
  • IsUpperCase
    Check argument string is UPPER_CASE.

If first character is digit, IsCamelCase, IsPascalCase and IsFlatCase always returns false.
Because cannot judge upper or lower.