![]() ![]()
|
R-INDEX function
Returns an INTEGER value that indicates the position of the target string within the source string. In contrast to the INDEX function, R-INDEX performs the search from right to left.
Syntax
sourcetarget
A CHARACTER or LONGCHAR expression whose position you want to locate insource. Iftargetdoes not exist withinsource, R-INDEX returns 0.If astartingparameter is not specified, then the search for thetargetpattern begins at the right-most character. Even though the search is started from the right, thetargetposition is calculated from the left. For example, this code returns a 3 rather than a 2:
startingExamplesThis procedure prompts you to enter a character string and a pattern to match against the string. It then displays the starting position of the string where the pattern was found.
This example also uses a
startingvalue:
Notes
- If either operand is case sensitive, then the R-INDEX function is also case sensitive.
- If either the
sourcestring ortargetpattern is null, the result is 0.- The R-INDEX function is double-byte enabled. You can specify
targetandsourcestrings for the R-INDEX function that contain double-byte characters.See also
![]() |
OpenEdge Release 10.2B
|
![]() ![]()
|