package
0.7.0
Repository: https://github.com/pirmd/text.git
Documentation: pkg.go.dev

# Functions

Cut cuts a string at end-of-line if the line "visual" length is shorter than the given limit or at word boundary (space) to stay as close as possible under the given limit.
LazyCut cuts a string at end-of-line if the line "visual" length is shorter than the given limit or at word boundary (space) to stay as close as possible under the given limit.
NewCutter creates a new Cutter.
NewLazyCutter creates a new Cutter that lazily manage word longer than maxwidth.
PadCenter equally prefixes and complete a slice of bytes with spaces until its "visual" size reaches the provided limit.
PadLeft prefixes a slice of bytes with spaces until its "visual" size reaches the provided limit.
PadRight completes a slice of bytes with spaces until its "visual" size reaches the provided limit.
Repeat repeats s until given "visual" size is reached.
Runewidth returns the visual width of a rune.
Stringwidth returns the "visual" width of string.
TrimLeadingSpace trims any leading space (as defined by Unicode) from a slice of bytes.
TrimSpace trims any leading and trailing space (as defined by Unicode) from a slice of bytes.
TrimSuffix trims trailing rune r.
TrimTrailingSpace trims any trailing space (as defined by Unicode) from a slice of bytes.
Truncate truncates the string so that its "visible" length is lower or equal to the provided limit.
Width returns the "visual" width of a slice of bytes.

# Structs

Cutter cuts a slice of bytes at end-of-line if the line's "visual" length is shorter than the maximum line limit or at word boundary to stay as close as possible under the maximum limit.