There's an alternative to loading arrays using loops in .NET too:
VB:
- Dim MyArray() As String = {"String1", "String2", "String3", "String4"}
C#
- string MyArray() = {"String1", "String2", "String3", "String4"}
That's just an FYI... if you're trying to load a large array, then using this feature likely isn't going to be any help...
Just to round out the previous comment - you didn't mention if you're using c# or vb so just on the off chance you're using vb:
VB:
- Dim MyArray(NumberOfItems) As String
-
For i = 0 To NumberOfItems
-
MyArray(i) = NumberOfItems
-
Next
Of course... an array list is easier to use:
VB:
- Dim MyArray As New ArrayList
-
For i = 0 To NumberOfItems
-
MyArray.Add("Item" & i)
-
Next
C#:
- ArrayList MyArray = new ArrayList;
-
for(i = 0; i < NumberOfItems; i++)
-
MyArray.Add("Item"& i);
Hope that helps...