### InStrRev

Basic and Crystal syntax.

##### Overloads

- InStrRev (inputString, findString)
- InStrRev (inputString, findString, startPosition)
- InStrRev (inputString, findString, startPosition, compare)

##### Arguments

- inputString is a String expression being searched.
- findString is a String expression being searched for.
- startPosition is an optional numeric expression that sets the starting position for each search. If omitted, -1 is used, which means that the search begins at the last character position.
- compare is an optional numeric value indicating the kind of comparison to use when evaluating substrings:
  - Performs a comparison that is case-sensitive
  - Performs a comparison that is case-insensitive

    If omitted, a case-sensitive comparison is performed.

##### Returns

Number value that indicates the position of the matching string in the string to be matched. The first character of the inputString (from the beginning) is 1.

##### Action

InStrRev returns the position of the first occurrence of one string within another. The matching proceeds in the reverse direction from the specified start position.

##### Examples

The following examples are applicable to Basic and Crystal syntax:

`InStrRev ("abcdefgbchijk", "bc")`

Returns 8, where matching starts from the very end of the string in the reverse direction.

`InStrRev ("abcdefgbchijk", "bc", -1)`

Returns 8, where matching starts from the very end of the string in the reverse direction.

`InStrRev ("abcdefgbchijk", "bc", 2)`

Returns 0, i.e., no match is found. Matching starts from the "b" in "ab" in the reverse direction.

`InStrRev ("abcdefgbchijk", "bc", 3)`

Returns 2. Matching starts from the "c" in "abc" in the reverse direction.

`InStrRev ("abcdefgbchijk", "bc", 10)`

Returns 8. Matching starts from the 'h' in "abcdefgbch" in the reverse direction, and the first occurrence of "bc" is found at position 8 from the beginning of the string s.

`InStrRev ("abcdefgbchijk", "BC", -1, 1)`

Returns 8. Matching starts from the very end of the string in the reverse direction, and the first occurrence of "BC", independent of case since case-insensitive comparison is specified, is found at position 8 from the beginning of the input string.

`InStrRev ("aBCdefgbchijk", "BC", -1, 0)`

Returns 2. Matching starts from the very end of the string in the reverse direction, and the first occurrence of "BC" is found at position 2 from the beginning of the string s.

##### Comment

This function is designed to work like the Visual Basic function of the same name.

Seagate Software, Inc. http://www.seagatesoftware.com Please send comments to: techpubs@seagatesoftware.com