Is there a way in VB.NET to declare an array, and later initialize it to a known length in the code? In other words, I'm looking for the VB.NET equivalent of the following C#.NET code:
string[] dest; // more code here dest = new string[src.Length]; I tried this in VB, and it didn't work.
Dim dest() as string ' more code here dest = New String(src.Length) What am I missing?
NOTE: I can confirm that
Dim dest(src.Length) as string works, but is not what I want, since I'm looking to separate the declaration and initialization of the array.
Redim-Redim dest(src.Length)Redim dest(src.Length-1).