Lookup(Of TKey, TElement).GetEnumerator Method
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Returns a generic enumerator that iterates through the Lookup(Of TKey, TElement).
Assembly: System.Core (in System.Core.dll)
Return Value
Type: System.Collections.Generic.IEnumerator(Of IGrouping(Of TKey, TElement))An enumerator for the Lookup(Of TKey, TElement).
Implements
IEnumerable(Of T).GetEnumeratorThe following example demonstrates how to use GetEnumerator to iterate through the keys and values of a Lookup(Of TKey, TElement). This code example is part of a larger example provided for the Lookup(Of TKey, TElement) class.
Dim output As New System.Text.StringBuilder ' Iterate through each Example in the Lookup and output the contents. For Each packageGroup As IGrouping(Of Char, String) In lookup ' Print the key value of the Example. output.AppendLine(packageGroup.Key) ' Iterate through each value in the Example and print its value. For Each str As String In packageGroup output.AppendLine(String.Format(" {0}", str)) Next Next ' Display the output. outputBlock.Text &= output.ToString() & vbCrLf
Show: