changecase

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2016 License: MIT Imports: 3 Imported by: 17

README

changecase

changecase is a port of npm package change-case. It provides helpful various text conversion functions.

Usage

import "github.com/ku/go-change-case"
changecase.Camel("go-change-case")  // returns "goChangeCase"

It contains following methods as original change-case does.

  • camel
    • goChangeCase
  • snake
    • go_change_case
  • pascal
    • GoChangeCase
  • param
    • go-change-case
  • dot
    • go.change.case
  • constant
    • GO_CHANGE_CASE
  • header
    • Go-Change-Case
  • path
    • go/change/case
  • sentence
    • Go change case
  • title
    • Go Change Case
  • no
    • go change case
  • lower
    • alias for strings.ToLower()
  • upper
    • alias for strings.ToUpper()
  • lcFirst
    • go-change-case
  • ucFirst
    • Go-change-case
  • swap
    • GO-CHANGE-CASE
  • isLower
    • Returns true if all the letters in given string are in lower case.
  • isUpper
    • Returns true if all the letters in given string are in upper case.

Documentation

Overview

Package changecase is a port of npm package change-case. It provides helpful various text conversion functions.

Index

Constants

View Source
const (
	INITIAL_STATE                 = iota
	EXPECT_FOLLOWING_SMALL_LETTER = iota
	IN_CONSECUTIVE_CAPITALS       = iota
	IN_WORD                       = iota
	SEEK_FOR_NEXT_WORD            = iota
)

Variables

This section is empty.

Functions

func Camel

func Camel(s string) string

func Constant

func Constant(s string) string

func Dot

func Dot(s string) string
func Header(s string) string

func IsLower

func IsLower(s string) bool

func IsUpper

func IsUpper(s string) bool

func LcFirst

func LcFirst(s string) string

func Lower

func Lower(s string) string

func NewLowerProcessor

func NewLowerProcessor(separator rune) *processor

func NewProcessor

func NewProcessor(t *CaseTranslator) *processor

func No

func No(s string) string

func Param

func Param(s string) string

func Pascal

func Pascal(s string) string

func Path

func Path(s string) string

func Sentence

func Sentence(s string) string

func Snake

func Snake(s string) string

func Swap

func Swap(s string) string

func Title

func Title(s string) string

func UcFirst

func UcFirst(s string) string

func Upper

func Upper(s string) string

Types

type CaseTranslator

type CaseTranslator struct {
	FirstLetter       func(rune) rune
	LetterInWord      func(rune) rune
	FirstLetterOfWord func(rune) rune
	Separator         rune
}

Jump to

Keyboard shortcuts

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