millisys 0 Posted October 3, 2014 (edited) Hi all, I am trying to create an array from the contents of an Edit control. Using the code below, it creates the array just fine, but each of the items returned from the array contains an LF line feed after the value (except for the last one). I have tried using _GUICtrlEdit_GetText as well as different delimiters such as @CRLF and @CR but they add additional line returns either before or after as well. Thank you for your help In the code below, the MsgBox will display "word is found" instead of the desired "word is found" Local $aFindReplace $aFindReplace = StringSplit(GUICtrlRead($findreplacelist), @LF) _ArrayDisplay($aFindReplace) For $x = 1 To UBound($aFindReplace) - 1 MsgBox($MB_SYSTEMMODAL, "", $aFindReplace[$x] & " is found") Next Edited October 3, 2014 by millisys Share this post Link to post Share on other sites
mikell 1,007 Posted October 3, 2014 (edited) ? #include <GUIConstantsEx.au3> #Include <Array.au3> GUICreate("My GUI edit") Local $idMyedit = GUICtrlCreateEdit("", 176, 32, 121, 97) GUISetState() GUICtrlSetData($idMyedit, "First line" & @CRLF & "Second line" & @CRLF & "Third line" & @CRLF, 1) Local $aFindReplace $aFindReplace = StringRegExp(GUICtrlRead($idMyedit), '.+', 3) _ArrayDisplay($aFindReplace) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd Edited October 3, 2014 by mikell Share this post Link to post Share on other sites
Zedna 276 Posted October 3, 2014 $aFindReplace = StringSplit(GUICtrlRead($findreplacelist), @LF) _ArrayDisplay($aFindReplace) Try this $aFindReplace = StringSplit(GUICtrlRead($findreplacelist), @CRLF, 1) or this $aFindReplace = StringSplit(StrinReplace(GUICtrlRead($findreplacelist),@CRLF,@LF), @LF) Resources UDF ResourcesEx UDF AutoIt Forum Search Share this post Link to post Share on other sites
millisys 0 Posted October 3, 2014 Thank you so much mikell and Zedna, both of those techniques work great. Have a great weekend! Share this post Link to post Share on other sites