name22

_StringGetLine

Dec 9th, 2012
149
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $sString = FileRead(@ScriptFullPath)
  2. MsgBox(0,"",_StringGetLine($sString, "ThisIsATest"))
  3.  
  4.  
  5. Func _StringGetLine($sSearchString, $sSubString, $iCasesense = 0, $iOccurence = 1, $iStart = 1)
  6.     ; -Author: name22 (www.autoit.de)
  7.     Local $iSearchPos = StringInStr($sSearchString, $sSubString, $iCasesense, $iOccurence, $iStart)
  8.     If @error Then Return SetError(1, 0, 0)
  9.     StringReplace(StringLeft($sSearchString, $iSearchPos), @CRLF, "")
  10.     Return SetError(0, 0, @extended + 1)
  11. EndFunc
RAW Paste Data