wordwrap

Wrap a String to a given number of characters.


Syntax


Parameters

  • String subject - The String to wrap.
  • Number width - The width at which to wrap (defaults to 75).
  • String break - The String to use at line ends (defaults to newline - ASCII code 10).
  • Boolean cut - Whether to split large words.
    • false (default) - Large words can make a line longer than width.
    • true - A word larger than width can be broken up.


Result

  • String - The wrapped String.

Returns subject wrapped at the column number specified by width, with each line terminated by break.