Posted By

icebob on 08/02/10


Tagged


Versions (?)

RPos (right-size Pos() )


 / Published in: Delphi
 

  1. function RPos(SubStr: string; S: string): integer;
  2. var
  3. I: integer;
  4. begin
  5. SubStr := String_Reverse(SubStr);
  6. S := String_Reverse(S);
  7. I := pos(SubStr, S);
  8. if I <> 0 then
  9. I := (Length(S) + 1) - (I + Length(SubStr) - 1);
  10. Result := I;
  11. end;

Report this snippet  

You need to login to post a comment.