Documentation ¶
Overview ¶
Package wordwrap provides functions for word wrapping to break long strings onto multiple lines with contraints on line length.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type WrapperFunc ¶
WrapperFunc takes a given input string, and returns some wrapped output. The wrapping may be altered by currying the wrapper function.
func Wrapper ¶
func Wrapper(limit int, breakWords bool) WrapperFunc
Wrapper creates a curried wrapper function (see WrapperFunc) with the given options applied to it. Create a WrapperFunc and store it is a variable, then re-use it elsewhere.
limit - The maximum number of characters for a line. breakWords - Whether or not to break long words onto new lines.
Example usage:
wrapper := wordwrap.Wrapper(10, false) wrapped := wrapper("This string would be split onto several new lines")
Click to show internal directories.
Click to hide internal directories.