I am currently iterating through a loop and redimensionalising my array every time I need to add a value (as you can imagine this takes some time for a redim every loop) is there a way I can implement a push similar to ruby or java? This would need to save the processing time needed to redimensionalise the array every time I need to add a value to it.
Cheers Martin
You'd be better off using a List (Of Type)
. Then you can just call the Add
method.
For example:
Dim foo As New List(Of String)
foo.Add("Bar")
You can concat the array, with a array containing only the new item, or multiple.
Array.Concat({Item}).ToArray
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With