12-13-2022, 09:43 AM
Here's about the simplest and easiest example I can imagine for use with _INSTRREV:
Start at the end of your text, work backwards, until you're at the front of your text. It's just that simple. If you can use INSTR, then you shouldn't have any issues using INSTRREV.
Code: (Select All)
a$ = "This is a string of text for testing."
Print a$
Print "INSTR demo"
Do
p = InStr(p + 1, a$, "i")
If p Then Print "i found at position #"; p
Loop Until p = 0
Print
Print
Print "_INSTRREV demo"
p = Len(a$)
Do
p = _InStrRev(p - 1, a$, "i")
If p Then Print "i found at position #"; p
Loop Until p = 0
Start at the end of your text, work backwards, until you're at the front of your text. It's just that simple. If you can use INSTR, then you shouldn't have any issues using INSTRREV.