STR_FIND_REVERSE
Use the STR_FIND_REVERSE script function to search for a character or a string (String 2) within a string (String 1).
The search starts at the end of the string that you search for.
The search is not case-sensitive.
Tip: To search from a particular starting point, use STR_FIND
Syntax
STR_FIND_REV[ERSE] (String1, String2)
Parameters
-
STR_FIND_REV[ERSE]
Searches for a character or a string within a string -
String 1
Alphanumeric string
Format: script literal or script variable -
String 2
Alphanumeric string
Format: script literal or script variable
Return codes
-
Position where the character or string was found
Note: The script function returns the first position where the search found String 2 as a value. The system counts the position starting with the beginning of String1. -
0
The character or string was not found
Example
The following example searches for the hash tag character (#) within the string "AE#01, AE#02". The system returns the value 10, and prints this result in the activation report.
AE#01, AE
:SET &STRING#="AE#01, AE#02"
:SET &SEARCH#="#"
:SET &POS#=STR_FIND_REVERSE(&STRING#,&SEARCH#)
:PRINT &POS#
In the following example, a string is searched. It is found at position 8.
:SET &POS#=STR_FIND_REV("AE#01, AE#02","AE")
:PRINT &POS#
See also: