Operator Scope of Action:
Operator First Added:
This function extracts the first N paragraphs of the referenced string or String-type attribute. Examples:
$MyString = "Paragraph 1\nParagraph 2".paragraphs(1);
In the example the "\n" simulates a line break. The code would set $MyString to the string "Paragraph 1".
$Text = $Text(Some note).paragraphs(2);
In the second example the current note's $Text would be set to the first 2 paragraphs of note "Some note".
To get a single given paragraph of a multi line/paragraph string, such as $Text, see String.split().
This function respects existing rich text styling.
$MyList = $Text.split("\n+");
Or from a different note, e.g. 'another note':
$MyList = $Text("another note").split("\n+");
\n+ implies to split on and remove sub-strings of one or more consecutive line breaks, thus avoiding the creation of unwanted creating blank list items in the output where there are several line breaks between paragraphs.