nthline(
TEXT
,
NUMBER
)

The nthline( function extracts the nth line from the text.


Parameters

This function has two parameters:

text – the original text.

number – position of the line to extract (1 for first line, 2 for second line, etc.) You can also use a negative number to specify the position from the end of the text (-1 for last line, -2 for second to last line, etc.)


Description

This function extracts the nth line from the text.

nthline("red
green
blue
yellow
orange",2) ☞ green

Negative values allow you to specify the line position relative to the end of the text (-1 for the last line, -2 for the second to last, etc.)

nthline("red
green
blue
yellow
orange",-2) ☞ yellow

Note: This function is equivalent to:

array(thetext,num,cr())

See Also


History

VersionStatusNotes
10.0UpdatedCarried over from Panorama 6.0, but now allows negative position values to specify the line position from the end of the text.