# findLine

### findLine(source, lineNo)

Find and return the "lineNo" line of the string matched. If lineNo is 0, return the last line.

## Arguments

Argument | Data Type | Description
source | string | String to search
lineNo | integer | Which line to return, starting form 1. If lineNo is 0, the LAST line is returned

## Returns

The first, second or which ever line is specified.

## Description

findLine() is used to find a line in a string. A line is defined as a sequence of alphabetic characters, excluding any combination of carriage return and line feed characters. It is equivalent to using the find() function:

find(source, "[^\r\n]+", 1)

The lineNo parameter allows you to specify which line to return - for example, if you are searching for the third line in a field, set lineNo = 3. You can also ask for the LAST line by setting lineNo = 0.

## Examples

Assume that the field Fld1 has the following text:

"The quick brown fox
jumps over the lazy dog
on a Sunday afternoon"

Example | Returns | Description
findLine(#Fld1, 1) | "The quick brown fox" | first line of text
findLine(#Fld1, 2) | "jumps over the lazy dog" | Finds the second line of text
findLine(#Fld1, 0) | "on a Sunday afternoon" | Finds the last line of text, no matter how many lines there are

## See Also

find(), findWord(), replace(), contains()