Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type WordWrapResult ¶
type WordWrapResult struct {
// TextGroups is the full text splits.
TextGroups []string
// WordCount is the total number of words in the text groups.
WordCount int
// CharCount is the total character count across all text groups.
CharCount int
}
WordWrapResult represents the wrap operation result.
func WordWrap ¶
func WordWrap(fullText string, width, maxWordCount int) (WordWrapResult, error)
WordWrap wraps the specified text to the given width (num of chars), returning an array element for each wrapped text group. If the maxWordCount is one or more, then wrapping will exit, if the word count exceeds the maxWordCount value.
func (WordWrapResult) IsValid ¶
func (w WordWrapResult) IsValid() bool
IsValid returns false, if a word count was stored, but no text groups processed, which means the max word count was exceeded.
Click to show internal directories.
Click to hide internal directories.