Dynamic arrays
Use this board to post your code snippets - tips and tricks
2 posts
Page 1 of 1
So I've had problem with dynamic arrays, or rather with their length.
Here is what I've found:
Here is what I've found:
Code: Select all
Next lets say we are parsing data and we need to set array length to parsed data length.
'Creating array
Dim SomeArray() As String
Code: Select all
Final part:
Dim newArray As String() = Data.Split(vbCrLf)
Code: Select all
But better would be do create array like
ReDim SomeArray(newArray.Length)
Code: Select all
in case if you will clear array before using it.Dim SomeArray(-1) As String
Specifying the array length as -1 in VB.Net will make an empty array. I suppose if you want to re-use the variable it might be useful.
2 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023