ccRevInstr

Syntax

UINT = ccRevInstr(Target:String,Search:String,OPT Pos = 0:Uint,OPT DirectionLeft = True:Uint,OPT CaseSensitive = True:Uint),Uint

Description

Finds the first occurrence of a search string -from the right- in a target string.

Parameters

target - String to perform the search on.
search - String to search for.
pos - Optional one based starting position to begin the search.-Valid from the left if DirectionLeft = True or from the right by DirectionLeft = False-
By Pos = 0 and DirectionLeft = True '0' will be replaced by LEN(Target) by DirectionLeft = False '0' will be replaced by '1' with that you get Direction dependent OPT for Pos
Direction (boolean)- Optional point of view that determines from where the Pos and Return value are counted from.

Return value

Returns the ones based position of the first occurrence of the search string in the target string.-from the right-
Valid from the left if DirectionLeft = True or from the right by DirectionLeft = False
Returns 0 if the search string could not be found.

Remarks

Example usage

A$ = "A string to search for something"
PRINT ccRevInstr(A$,"search",20,True,False)

See
ccRev-Instr_DEMO.eba
ccInstr()