Adding



Add


System.Collections.Generic.List<string> myList; 
myList = new System.Collections.Generic.List<string>(3);

myList.Add("one");
myList.Add("two");
myList.Add("three");
myList.Add "four";

myList.Add(new object[] {"text",50,False)};

AddRange

add multiple elements

System.Collections.Generic.List<string> myList; 
myList = new System.Collections.Generic.List<string>(3);
string sConCat;

sConCat = "one;two;three"
myList.AddRange(sConCat.Split(Ctype(";", Char)))

Insert a single element


Insert multiple elements




InsertRange

System.Collections.Generic.List<string> moreItems; 
moreItems = new System.Collections.Generic.List<string>(4);

for (int i=0; i<moreItems.Count; i++)
{
   moreItems[i] = 200;
}
myList.InsertRange(2, moreItems);



© 2023 Better Solutions Limited. All Rights Reserved. © 2023 Better Solutions Limited TopPrevNext