wrap

Wraps text so that each line has a specified maximum number
of characters.

wrap(String, limit [, strip]) → returns string

wrap Argument Reference

String string
Required

String or variable that contains one. The text to wrap.

limit numeric
Required

Positive integer maximum number of characters to allow on
a line.

strip boolean
Default: false

whether to remove all existing newline and carriage return
characters in the input string with spaces before wrapping
the text. Default: False.
Values:
  • true
  • false

Fork me on GitHub