Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Camel ¶
func Camel(s string, options ...CamelOption) string
func FirstNRunes ¶
Returns the string consisting of the first `n` runes found.
It is the caller's responsibility to ensure that the string contains valid runes throughout. If a rune cannot be decoded, utf8.RuneError will be used in its place.
If `n` exceeds the number of runes in string `s`, `s` is returned unmodified.
func LcFirst ¶
LcFirst returns a string with the first rune in upper case. If for any reason we fail to decode the first rune in the string, the same string is returned instead of an error.
func Snake ¶
func Snake(s string, options ...SnakeOption) string
Types ¶
type CamelOption ¶
type CamelOption interface {
Option
// contains filtered or unexported methods
}
func WithLowerCamel ¶
func WithLowerCamel(v bool) CamelOption
WithLowerCamel specifies that the first letter of a camel cased string should be lower cased
type SnakeOption ¶
type SnakeOption interface {
Option
// contains filtered or unexported methods
}
func WithDelimiter ¶
func WithDelimiter(r rune) SnakeOption
WithDelimiter allows you to change the delimiter used in snake case coversion
func WithScreaming ¶
func WithScreaming(v bool) SnakeOption
WithScreaming specifies that the conversion to snake case should produce words in all uppercase (e.g. SNAKE_CASE)