string.wrap()

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

string.wrap( limit=number, strip=boolean )

Returns: String

Argument Description
limit
number, required

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

strip
boolean, optional

Whether to remove all existing newline and carriage return characters in the input string with spaces before wrapping the text.

Examples

string = "Thewayaredifbutdesareone";
res = string.wrap(3);
writeDump(res);
string2 = "onetwosixten";
res = string2.wrap(3);
writeDump(res);
string3 = "this is a string"
res = string3.wrap(4);
writeDump(res);

See also