Speed optimization of latest Nine's code:
In StringInStr() and StringReplace() use CaseSense=1, this is MUCH faster
orig:
Func _TabsToSpaces($sString, $iTabLen = 8)
Local $iMod, $iSpaceLeft
Local $iTabPos = StringInStr($sString, @TAB)
While $iTabPos
$iMod = Mod($iTabPos, $iTabLen)
$iSpaceLeft = $iMod ? $iTabLen - $iMod : 0
$sString = StringReplace($sString, Chr(9), _StringRepeat(" ", $iSpaceLeft + 1), 1)
$iTabPos = StringInStr($sString, @TAB)
WEnd
Return $sString
EndFunc ;==>_TabsToSpaces
optimised:
Func _TabsToSpaces($sString, $iTabLen = 8)
Local $iMod, $iSpaceLeft
Local $iTabPos = StringInStr($sString, @TAB, 1)
While $iTabPos
$iMod = Mod($iTabPos, $iTabLen)
$iSpaceLeft = $iMod ? $iTabLen - $iMod : 0
$sString = StringReplace($sString, Chr(9), _StringRepeat(" ", $iSpaceLeft + 1), 1, 1)
$iTabPos = StringInStr($sString, @TAB, 1)
WEnd
Return $sString
EndFunc ;==>_TabsToSpaces