Page 1 of 1

string::wrapString/4 documentation

Posted: 12 Dec 2020 15:56
by Harrison Pratt
wrapString : (string String, charCount HyphenLength, charCount MaxLength, string Indent) -> string* Lines.
% @short
% @detail #HyphenLength <= #MaxLength
% @example
% % All the statements below succeed:
% ["123456","7890"] = string::wrapString("1234567890", 6, 6, "")
% ["123456","7890"] = string::wrapString("1234567890", 2, 6, "")
% @end

I believe that the second example should read:

["12", "34", "56", "78", "90"] = string::wrapString("1234567890", 2, 6, "")

It is not clear to me what the MaxLength parameter is intended to control in this predicate.

It is useful that wrapString/4 handles breaking on tab, ':', ';' and ',' characters.