本文整理汇总了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