« Macs on ebay | Home | How to Avoid Economic… »

InStrR Function: Search the last postition of a string in a string

Same as InstrR, but returns the last position, not the first one:
  Function InStrR(Target As String, Find as string) As integer
Dim LastP As integer = 0
Dim P As integer = InStr(Target, Find)

While P>0
LastP = P
P = InStr(LastP + 1, Target, Find)

return LastP
End Function
Claris FileMaker Plugin
05 05 10 - 15:03