Documentation
¶
Overview ¶
Package strings contains functions to manipulate strings
Index ¶
- func CamelCase(in string) string
- func Indent(width int, indent, s string) string
- func KebabCase(in string) string
- func ShellQuote(s string) string
- func SnakeCase(in string) string
- func Sort(list []string) []stringdeprecated
- func Trunc(length int, s string) string
- func WordWrap(in string, opts WordWrapOpts) string
- type WordWrapOpts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Indent ¶
Indent - indent each line of the string with the given indent string. Any indent characters are permitted, except for '\n'.
TODO: return an error if the indent string contains '\n' instead of succeeding
func ShellQuote ¶
ShellQuote - generate a POSIX shell literal evaluating to a string
func WordWrap ¶
func WordWrap(in string, opts WordWrapOpts) string
WordWrap - insert line-breaks into the string, before it reaches the given width.
Types ¶
type WordWrapOpts ¶
type WordWrapOpts struct { // Line-break sequence to insert (defaults to "\n") LBSeq string // The desired maximum line length in characters (defaults to 80) Width uint }
WordWrapOpts defines the options to apply to the WordWrap function
Click to show internal directories.
Click to hide internal directories.