Wrap

Wraps a string at the specified limit, breaking at the last space within the limit.

Method Signature

Wrap(string=[string], limit=[integer], strip=[boolean])

Arguments

Argument
Type
Required
Description
Default

string

string

true

The string to wrap.

limit

integer

true

The character limit at which to wrap the string.

strip

boolean

false

If true, replaces all line endings with spaces before wrapping. Default is false.

false

Examples

Last updated

Was this helpful?