Integer Array

prizren

New member
Joined
Jun 23, 2009
Messages
4
Programming Experience
Beginner
Hello,

What is the best way to add/remove items to an integer array?

Example:
Dim Test() as Integer = {2,8}

how do i add another item? how do i remove "8"?
 
Use a List(Of T).
VB.NET:
Dim ints As New List(Of Integer)
ints.AddRange(New Integer() {2, 8})
ints.Add(6)        
ints.Remove(8)
'or 
ints.RemoveAt(1)
 
How do I then convert from "ints As New List(Of Integer)" to "ints() as Integer"?

A function i'm using needs it as "ints() as integer".
 
Back
Top