You could try Redim
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GuiListBox.au3>
#include <Array.au3>
Local $aResult[1][1]
#Region ### START Koda GUI section ### Form=c:\users\user\desktop\script\stringsplit1.kxf
$Form1_1 = GUICreate("Form1", 219, 98, 192, 114)
$Input1 = GUICtrlCreateInput("", 24, 16, 169, 21)
$Split = GUICtrlCreateButton("Split", 64, 48, 75, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Split
$read = GUICtrlRead($Input1)
If $read = "" Then
MsgBox(16, "Blank Input", "Blank")
Else
$STRIP = StringStripWS($read, $STR_STRIPALL)
_StringToArray(StringSplit($STRIP, ","))
_ArrayDisplay($aResult)
EndIf
EndSwitch
WEnd
Func _StringToArray($aSplit)
If $aSplit[0] = 1 Then _ArrayAdd($aResult, $aSplit[1])
If UBound($aResult, 2) < $aSplit[0] Then
ReDim $aResult[UBound($aResult)][$aSplit[0]]
_ArrayAdd($aResult, _ArrayToString($aSplit, "|", 1))
EndIf
$aResult[0][0] = UBound($aResult) - 1
EndFunc