The Tip: InStr() works as I am searching for right-most pipe
SetBatchLines -1 Loop, %A_WinDir%\System32\*.*, 0 ,0 sStr .= A_LoopFileLongPath "|" Len:=StrLen( sStr ), ATC:=A_TickCount StringReplace, sStr, sStr, |, |, UseErrorLevel Loop % (cCount := ErrorLevel ) NumPut( 0, sStr, InStr(sStr,"|",0,[color=Red]0[/color])-1, "Char" ) MsgBox, 0, String Length: %Len%, % (A_TickCount-ATC) "ms to replace " cCount " characters"