回复 8# afan
Func _FileLineFindKey($str, $sKey)
Local $iStart = StringInStr($str, $sKey)
If @error Then Return SetError(1)
Local $str1 = StringMid($str, 1, $iStart)
Local $time=TimerInit()
;~ StringRegExpReplace($str1, @CRLF, '')
StringReplace($str1, @CRLF, '')
$time=TimerDiff($time)
ConsoleWrite($time&@LF)
Return @extended + 1
EndFunc ;==>_FileLineFindKey
$str='111111'&@CRLF& _
'222222'&@CRLF& _
'333333'&@CRLF& _
'444444'&@CRLF& _
'555555'&@CRLF& _
'666666'
ConsoleWrite(_FileLineFindKey($str, '222222')&@LF)
我反复测试,StringReplace都要比StringRegExpReplace快!你再试试?! |