wrap
fn
S 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
s | text string to be wrapped |
columns | maximum number of _columns in the paragraph |
firstindent | string used to _indent first line of the paragraph |
indent | string to use to _indent following lines of the paragraph |
tabsize | column 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.