Documentation ¶
Overview ¶
Package text provides text manipulation functions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Dedent ¶
Dedent removes a common indent from all lines in a string. It allows writing multi-line strings in a more readable way. For example:
const s = text.Dedent(` foo bar baz `)
The result is:
foo bar baz
The common indent is the number of leading spaces in the first non-empty line. If a line does not have the common prefix, it is reproduced as is, except for the last line, which is ignored if it is blank.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.