StringWrapExtensions extension
Word wrap and grapheme-safe truncation.
- on
Methods
-
preventOrphans(
{int minWrapChars = 4}) → String -
Available on String, provided by the StringWrapExtensions extension
Replaces a breaking space with a non-breaking space (\u{00A0}) wherever a line wrap at that space would strand a token shorter thanminWrapCharson its own line. -
truncateAtGrapheme(
int maxGraphemes) → String -
Available on String, provided by the StringWrapExtensions extension
Truncates at grapheme boundary so no emoji or extended grapheme is cut. -
wordWrap(
int columnWidth) → List< String> -
Available on String, provided by the StringWrapExtensions extension
Wraps this string atcolumnWidth, breaking at word boundaries when possible.