Name: itemOffset

Type: function

Syntax: itemOffset(<itemToFind>, <stringToSearch> [, <itemsToSkip>])

Summary:
<return|Returns> the number of <items> between the beginning of a
<value> and an occurrence of a specified <string>.

Introduced: 1.0

OS: mac, windows, linux, ios, android

Platforms: desktop, server, mobile

Example:
itemOffset("C","A,B,C,D,E") -- returns 3

Example:
itemOffset("C","A,B,C,D,E",2) -- returns 1

Example:
itemOffset("D,E","A,B,C,D,E") -- returns 4

Parameters:
itemToFind (string):


stringToSearch (string):


itemsToSkip:
A non-negative integer. If you don't specify how many itemsToSkip, the
itemOffset function does not skip any items.

Returns:
The <itemOffset> <function> <return|returns> a <non-negative> <integer>.

Description:
Use the <itemOffset> <function> to find which <item> a <string> occurs
in. 

The value returned by the <itemOffset> <function> is the number of the
<item> where <itemToFind> first appears in <stringToSearch>. If the
<itemToFind> is not in <stringToSearch>, the <itemOffset> <function>
<return|returns> zero.

If the <itemToFind> contains more than one <item>, and the entire
<itemToFind> appears in the <stringToSearch>, the <itemOffset>
<function> <return|returns> the <item> number where the <itemToFind>
starts. 

If you specify how many <itemsToSkip>, the <itemOffset> <function> skips
the specified number of <items> in the <stringToSearch>. The <value>
<return|returned> is relative to this starting point instead of the
beginning of the <stringToSearch>.

References: function (control structure), wordOffset (function),
offset (function), value (function), return (glossary),
non-negative (glossary), item (keyword), integer (keyword),
items (keyword), string (keyword), wholeMatches (property),
itemDelimiter (property)

Tags: text processing

