Working with Lists

  • myList = new list(Of String) [initializes new list of strings]
  • myList = new list(Of String()) [initializes new list of string arrays]
  • myList(0) = "Hello" [sets the first item of the list]
  • mySpecialString = myList(5) [gets the sixth item of the list]
  • Add("Hello") [adds "Hello" at the end of the list]*
  • Insert(3, "Hello") [inserts "Hello" after the third item]*
  • myIndex = myList.IndexOf("Hello") [returns the index of the item "Hello"]
  • doesContain = myList.Contains("Hello") [checks if the list contains the item "Hello" and returns true/false]
  • myListCount = myList.Count [returns the number of items in the list]
Was this article helpful?
0 out of 0 found this helpful