The text to line wrap.
The options to line wrap with.
Performance: With character-based wrapping, this function can calculate the entire amount of space needed for the resulting string, resulting in only a single GC allocation.
A newly allocated string containing the eagerly-evaluated results of asLineWrapped(text, options).
Exception if the char limit is too small to show any text.
const options = LineWrapOptions(8, "\t", "-"); const text = "Hello world".lineWrap(options); assert(text == "\tHello-\n\tworld-", text);
LineWrapRange for full documentation.
asLineWrapped for a lazily evaluated version.
Same thing as asLineWrapped, except it is eagerly evaluated.