« 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)
wend

return LastP
End Function
The biggest plugin in space...
05 05 10 - 15:03