Tag: fastPos预览模式: 普通 | 列表

分享Pos函数.(比FastPos还要快)

function QuickPos(const Substr, S: WideString; MatchesIndex: Integer = 1): Integer;
function QuickPosBack(const Substr, S: WideString; MatchesReverseIndex: Integer = 1): Integer;

主要用途是搜索字符串中第n个Substr。
经过测试,这2个函数的速度比直接用Pos+Copy快好几倍(如果字符串够长,可能10几倍)
比Pos+Delete(如JVCL的函数NPos)处理要快(至少2-3倍以上)。

查看更多...

Tags: QuickPos fastPos

分类:技术文章 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 622