VB List: Add Items with Examples
In VB, you can use the Add method to add content to a List. Here is an example:
Dim myList As New List(Of String) ' 声明一个名为myList的List(Of String)对象
myList.Add("Item 1") ' 将"Item 1"添加到myList中
myList.Add("Item 2") ' 将"Item 2"添加到myList中
myList.Add("Item 3") ' 将"Item 3"添加到myList中
When using the Add method to add content to a List, you need to specify the item you want to add. In the example above, we added the strings “Item 1”, “Item 2”, and “Item 3” to myList.