本文整理匯總了VB.NET中System.Array.GetEnumerator方法的典型用法代碼示例。如果您正苦於以下問題:VB.NET Array.GetEnumerator方法的具體用法?VB.NET Array.GetEnumerator怎麽用?VB.NET Array.GetEnumerator使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Array
的用法示例。
在下文中一共展示了Array.GetEnumerator方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。
示例1: SamplesArray
Public Class SamplesArray
Public Shared Sub Main()
' Creates and initializes a new Array.
Dim myArr(10) As [String]
myArr(0) = "The"
myArr(1) = "quick"
myArr(2) = "brown"
myArr(3) = "fox"
myArr(4) = "jumps"
myArr(5) = "over"
myArr(6) = "the"
myArr(7) = "lazy"
myArr(8) = "dog"
' Displays the values of the Array.
Dim i As Integer = 0
Dim myEnumerator As System.Collections.IEnumerator = myArr.GetEnumerator()
Console.WriteLine("The Array contains the following values:")
While myEnumerator.MoveNext() And Not (myEnumerator.Current Is Nothing)
Console.WriteLine("[{0}] {1}", i, myEnumerator.Current)
i += 1
End While
End Sub
End Class
輸出:
The Array contains the following values: [0] The [1] quick [2] brown [3] fox [4] jumps [5] over [6] the [7] lazy [8] dog