Seiki Batch Script > String Functions

findr

Reports the index position of the last occurrence of a specified string within a string

Class: String

Parameters:  $string – The string to be searched

                     $search – The search string

Syntax: index=findr($string, $search)

Returns:

•      If $search is found – The index of $search in $string as an integer

•      If $search is not found – -1

Remarks:

•      The returned index starts at 0

•      Search criteria is case insensitive

Example:

//Example for the string findr method

$s=”05/01/67” //Set string

$srch=”/” //Set search string

idx=findr($s, $srch) //Result (= 4)

message(“Search string “ + $srch + “ found at index “ + idx) //Display results message

 

See Also:    find