Documentation
¶
Overview ¶
Package collapsewhitespace contains a function that collapses whitespace between characters (runes) in a string such that all non-whitespace is only separated by at most one space character.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func String ¶
String collapses any whitespace that is not a single standalone space, into a single space.
Whitespace is:
'\t', '\n', '\v', '\f', '\r', ' ', U+0085 (NEL), U+00A0 (NBSP).
Example ¶
package main import ( "fmt" "4d63.com/collapsewhitespace" ) func main() { s := collapsewhitespace.String("abc def \nghi") fmt.Print(s) }
Output: abc def ghi
Types ¶
This section is empty.