FT_AT2()
Find position of the nth occurrence of a substring
──────────────────────────────────────────────────────────────────────────────

Syntax

FT_AT2( <cSearch>, <cTarget> [, <nOccurs> [, <lCaseSens> ] ] ) -> nPos

Arguments

<cSearch> is the character substring to search for.

<cTarget> is the character string to search.

<nOccurs> is the occurrence of cSearch to look for,
defaults to 1.

<lCaseSens> is a logical value denoting case sensitivity.
If .F., then search is NOT sensitive to case,
defaults to .T.

Returns

The position of the nth occurrence of a substring

Description

This function will find the nth occurrence of a substring
within a string.

Examples

cSearch := "t"
cTarget := "This is the day that the Lord has made."

FT_AT2( cSearch, cTarget ) // Returns ( 9 )

FT_AT2( cSearch, cTarget, 2 ) // Returns ( 17 )

FT_AT2( cSearch, cTarget, 2, .F. ) // Returns ( 9 )

Source: AT2.PRG

Author: Ralph Oliver, TRANSCOM SYSTEMS