至黑之夜金属dc:delphi中怎样查询第二次出现的字符串

来源:百度文库 编辑:查人人中国名人网 时间:2024/05/04 13:16:38
POS只能找第一次出现的字符串,我想找第二次出现的该用什么函数???

好像没什么函数找第二次出现的字符串,得自己定义一个
试试这个函数
function NextPos(SearchStr, Str: string; Position: Integer): Integer;
begin
Delete(Str, 1, Position - 1);
Result := Pos(SearchStr, upperCase(Str));
if Result = 0 then Exit;
if (Length(Str) > 0) and (Length(SearchStr) > 0) then
Result := Result + Position + 1;
end;

这个包里字符处理函数更多,如果你用到字符处理的话,这个可能对你有用
http://www.box.net/index.php?rm=box_v2_download_shared_file&file_id=f_13530293
以上引自超级猛料
====
不好意思,上面地址发错了,已更正