Returns the number of lines between the beginning of a value and an occurrence of a specified string.
Built-in Function handler[]
Syntax:
lineOffset(<lineToFind>, <stringToSearchInto> [, <linesToSkip>])
Examples:
lineOffset("cheese",foodsList)
put subbedData into line (lineOffset(it,receivedData)) of receivedData
Use the lineOffset function to find which line a string occurs in.
The value returned by the lineOffset function is the number of the line where lineToFind appears in stringToSearch. If the lineToFind is not in stringToSearch, the lineOffset function returns zero. If the lineToFind is more than one line, the lineOffset function always returns zero, even if the lineToFind appears in the stringToSearch.
If you specify how many linesToSkip, the lineOffset function skips the specified number of lines in the stringToSearch. The value returned is relative to this starting point instead of the beginning of the stringToSearch.
Parameters:
- lineToFind (string): the line to search
- stringToSearch (string): the text you are searching in
- linesToSkip: A non-negative integer. If you don't specify how many linesToSkip, thelineOffset function does not skip any lines.
- Returns: The lineOffset function returns a non-negative integer.
See also: offset (function),value (function),wholeMatches (property), WordOffset, ItemOffset