function RPos(const SubStr, Str: String): Integer;
var
I, X: Integer;
LenSubStr: Integer;
begin
I := Length(Str);
LenSubStr := Length(SubStr);
while I >= LenSubStr do
begin
if Str[I] = SubStr[LenSubStr] then
begin
X := 1;
while (X < LenSubStr) and (Str[I - X] = SubStr[LenSubStr - X]) do
Inc(X);
if X = LenSubStr then
begin
Result := I - LenSubStr + 1;
Exit;
end;
end;
Dec(I);
end;
Result := 0;
end;
Users browsing this forum: No registered users and 18 guests