Documentation ¶
Index ¶
Constants ¶
View Source
const ( CamelCase = "camelcase" LispCase = "lispcase" PascalCase = "pascalcase" SnakeCase = "snakecase" Mirror = "mirror" LineLength = 60 )
Variables ¶
This section is empty.
Functions ¶
func CenterAlignedPadded ¶
Consider 60 char width outputs "xyz" as "---- xyz -------"
func Format ¶
func Format(txt string, transformFormat TransformFormat) string
func JoinFormatted ¶
func JoinFormatted(words []string, transformFormat TransformFormat) string
func Split ¶
NOTE: This code is copied from https://github.com/fatih/camelcase/blob/master/camelcase.go Splitting rules
- If string is not valid UTF-8, return it without splitting as single item array.
- Assign all unicode characters into one of 4 sets: lower case letters, upper case letters, numbers, and all other characters.
- Iterate through characters of string, introducing splits between adjacent characters that belong to different sets.
- Iterate through array of split strings, and if a given string is upper case: if subsequent string is lower case: move last character of upper case string to beginning of lower case string
Types ¶
type TransformFormat ¶
type TransformFormat string
Click to show internal directories.
Click to hide internal directories.