wrap

fnS wrap(S)(S s, in size_t columns = 80, S firstindent = null, S indent = null, in size_t tabsize = 8) if (isSomeString!S)

Wrap text into a paragraph.

The input text string s is formed into a paragraph by breaking it up into a sequence of lines, delineated by \n, such that the number of columns is not exceeded on each line. The last line is terminated with a \n.

Parameters

stext string to be wrapped
columnsmaximum number of _columns in the paragraph
firstindentstring used to _indent first line of the paragraph
indentstring to use to _indent following lines of the paragraph
tabsizecolumn spacing of tabs in firstindent[] and indent[]

Returns

resulting paragraph as an allocated string

Bugs

Columns are counted as the number of code points in the string. This may

not correspond with the actual number of columns displayed if the string contains combining characters, modifiers, zero-width characters, or double-width characters.