can someone please help me. why does this return an error:
Dim stuff As New System.Collections.ArrayList()
Dim i As Integer
i = 1
Dim split As String() = temp_string.Split(",")
For Each s As String In split
If s.Trim() <> "" Then
stuff(i) = s
i = i + 1
End If
Next s
the st开发者_运维百科uff(i)=2 line is returning the mentioned error
Use stuff.Add(i) instead of that, you accessing not an array but a list which doesn't have an index upon creation only after you assign values you can access it's indexes as an array.
Looks like it could be an off by one error. What is i initialized to? 0 or 1?
精彩评论