formatlinebreaks()
Description
This function processes the incoming text and rewrites it to fit certain requirements, such as being indented a certain amount and having lines of a certain maximum length. It is commonly used to reformat content for pretty printers or when converting from one format to another or when outputting some results into a text-based format.
Note | |
---|---|
It is important to realize that this code will not remove existing line breaks, only break lines that are too long. To use this code to reformat existing text, remove all line breaks from the input first! |
Prototype
formatlinebreaks
(
string
,
string sIndent
,
integer sOrig
,
string iLinewidth
,
boolean sEOL
,
boolean preservewhitespace
)
skipindentonfirstline
Parameters
Parameter | Default value | Type name | Description |
---|---|---|---|
sIndent | None | string | |
sOrig | None | string | |
iLinewidth | None | integer | |
sEOL | | string | |
preservewhitespace | .false | boolean | |
skipindentonfirstline | .false | boolean |