HomeManualTopicsTypesSymbols

std::wrap_words

wraps a string consisting of words onto multiple lines

Parameters

text
the string to wrap
width
the desired line width

Results

None

Description

The string is split into multiple lines according to the specified line width.

The result is a list of lines.

Example

$str "This is a very long string that should be wrapped onto multiple lines" $lines wrap_words(str 30) dump! 2 `lines

Output

lines: list "This is a very long string" "that should be wrapped" "onto multiple lines"

Topic

Strings

See also

std::indented increases the indent of the specified (multi-line) string