Sub Split(delimit as string, s as string) as string()
'***
' calculate the amount of items you need to return
dim count as int = 10 ' 10 in this example
dim x(count) as string
' Fill x(0) to x(9) .....
return x
End Sub
Thanks for responding.
Actually my query is more about the portion of codes marked with '***'.
While calculating the amount of items I need to return, I will at the same time capturing the item 1 by 1.
This is happening before I declare the array 'Dim x(count) as string'.
From your expert opinion, where should the captured items to be stored before they are loaded to the array for returning.
Is it better to do this:
' create a large array
Dim x(99999) as string
'... capture items to x and count it, let say count=10
'redim array
dim x(count) as string
return x
Or do this:
' create a list
Dim y as list
'... capture items to y, let say count = list size = 10
'create array with list size
dim x(count) as string
' Fill x(0) to x(count-1) .....
return x