本帖最后由 panhao1 于 2010-1-26 17:07 编辑
来源为ms官网
自己整理了一下 不知道怎么调字体 55555~~
定义
Dim instance As
New List()
——————————————————————————
Dim capacity As
Integer
Dim instance As
New List(capacity)
——————————————————————————————
Dim collection As IEnumerable(Of T)
Dim instance As
New List(collection)
Eg:
Dim dinosaurs As New List(Of String)
——————————————————————————
Dim dinosaurs As New List(Of String)(4)
A List(Of (T)) of strings with a capacity of 4 is created
————————————————————————————————————————
Dim input() As String = { "Brachiosaurus", "Amargasaurus","Mamenchisaurus" }
Dim dinosaurs As New List(Of String)(input)
The collection whose elements are copied to the new list.
成员
1 List(Of (T)).Capacity
Dim instance As List
Dim value As Integer
value = instance.Capacity
instance.Capacity = value
2 List(Of (T)). Count
Dim instance As List
Dim value As Integer
value = instance.Count
Capacity is the number of elements that the List (Of (T)) can store before resizing is required. Count is the number of elements that are actually in the List(Of (T)).
3List(Of (T)).Item
Dim instance As List
Dim index As Integer
Dim value As T
value = instance.Item(index)
instance.Item(index) = value
Gets or sets the element at the specified index |