Documentation
¶
Overview ¶
Package textutil holds small string helpers shared across packages.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Clip ¶ added in v0.2.1
Clip cuts text to at most maxRunes runes, mark included, ending the cut with mark ("…", "..." or a notice); maxRunes <= 0 keeps text whole.
func ClipBytes ¶ added in v0.2.1
ClipBytes cuts text to at most maxBytes bytes on a rune boundary, for limits counted in bytes (a websocket close reason).
func FirstNonEmpty ¶
FirstNonEmpty returns the first value that is not blank, trimmed. Use cmp.Or instead when the values are already trimmed.
func UniqueNonBlank ¶
UniqueNonBlank is NonBlank without repeats; the first occurrence stays.
Types ¶
This section is empty.