Page 1 of 1

function @rinstr not working properly

Posted: Thu Jun 25, 2026 4:13 am
by mamo
I use Eviews 14 Dec26 2024 build

The function @rinstr does not work as described in the help documentation which says:
Starting at the end of the string and searching in reverse, finds the starting position of the target string str2 in the string str1. By default, the function returns the location of the last (first from the end) instance of str2 in str1, but you may provide the optional integer n to change the occurrence.
Proof:

Code: Select all

!i=@rinstr("987654321", "8") Stautsline !i ' gives !i=2, rather than !i=8
So it seems @rinstr works in the same way as @instr, counting from left to the right.

Re: function @rinstr not working properly

Posted: Thu Jun 25, 2026 10:53 am
by EViews Matt
Hello,

The @rinstr function is behaving as intended. While the @rinstr function performs a right-to-left search for a matching substring, in contrast to @instr's left-to-right search, both functions return a character location for the match, which is numbered left-to-right starting at 1. The search orders are different, but the results are presented in the same coordinate system.