Operator Type:
Operator Scope of Action:
Operator Purpose:
Operator First Added:
Operator Altered:
Property [other Property type actions]
Item [operators of similar scope]
Data manipulation [other Data manipulation operators]
9.0.0
String.paragraphList
The .paragraphList operator returns a list of paragraphs contained in a string. This operator requires running on macOS 10.14 and later. For example, to get a list of the discrete paragraphs in $Text:
$MyList = $Text.paragraphList;
To set a string to the third paragraph of $Text (recall the .at(N) operator is zero-based):
$MyString = $Text.paragraphList.at(2);
If wanting to iterate and test paragraphs, rather than chain $Text.paragraphList.each(){}, use the newer stream parsing method $Text.eachLine(){}. In both instance a line—or paragraph—is a substring—delimited by one of more successive line breaks.