wordwrap() function

Returns a string wrapped to a maximum/minimum number of characters.

Syntax

wordwrap(string,wrap_length[,delimiter_string])

Arguments

string → is string. The string to be wrapped.
wrap_length → is number. If positive, the number represents the ideal maximum number of characters to wrap; if negative, the number represents the minimum number of characters to wrap.
delimiter_string → is string. The delimiter string to wrap to a new line (optional).

Example

wordwrap('UNIVERSITY OF QGIS',13) → 'UNIVERSITY OF\nQGIS'
wordwrap('UNIVERSITY OF QGIS',-3) → 'UNIVERSITY\nOF QGIS'