{反向查找字符串} function TForm1.ReversePos(SubStr, S: String): Integer; var TemPos : Integer; //查找到的位置 begin {把每个字符串都反过来,再pos找地址} TemPos := Pos(ReverseString(SubStr), ReverseString(S)); if TemPos > 0 then {得到正序位置} TemPos := Length(S) - TemPos - Length(SubStr) + 2; Result := TemPos; end;