Page 2 of 2

Re: Findstring from the End

Posted: Sun Feb 23, 2014 10:04 pm
by Thunder93
To have mine continue further in with the negative searches, add just before the line;

Code: Select all

fResult = FindString(ReverseString(String), ReverseString(StringToFind) , StartPosition, Mode)
this;

Code: Select all

StartPosition = -StartPosition
Example: Debug FindString("Hello i'm KCC for ever", "o", -8)

:lol:

Re: Findstring from the End

Posted: Sun Mar 08, 2020 6:57 am
by Rinzwind
Some kind of find reverse string procure should be included. First reversing the string is inefficient. Of course we can come up with 10 own solutions of various efficiency and stability, but this is a common operation that occurs too frequently to not be included in the product. Could just be an optional parameter in the existing findstring. Just keep counting chars left to right, but with search direction right to left.

Related, StringField could handle a negative index as right to left index...