This version is out of date, covering development from v8.0.0 to v8.x.x. It is maintained here only for inbound reference links from elsewhere. It is no longer actively updated.

Jump to the current version of aTbRef

Tinderbox v8 Icon

String.paragraph(N)


Operator Type: 

Operator Scope of Action: 

Operator Purpose: 

Operator First Added: 

Operator Altered: 

 Function   [other Function type actions]

 Item   [operators of similar scope]

 Data manipulation   [other Data manipulation operators]

 

 


String.paragraph(N)

returns the test of the Nth paragraph in the string. N is zero-based, i.e. the first paragraph is .paragraph(0); empty paragraphs are ignored. If the string does not contain N paragraphs, the result is an empty string.

If N is negative, Tinderbox counts from the last paragraph. Thus, $Text.paragraph(-1) is the last paragraph in the text.

NOTE: only available on macOS 10.13 or later.

$MyString = $Text.paragraph(2); 

sets $MyString the the contents of the third paragraph of $Text—recall at N is zero-based, so counting 0/1/2 means 2 is #3 in the sequence.