' Visual Basic 2008 9.0 .NET Examples - Query Methods - New in Visual Basic 2008 - 9.0 : Public Class Example3 Public Shared Sub Main() Dim source1 = New Object() {1, "two", "3"c, "four", 5.0} Dim words As IEnumerable(Of String) = source1.OfType(Of String)() For Each word As String In words Console.WriteLine(word) Next Console.WriteLine() ' Dim source2 As New ArrayList source2.Add(New Counter With {.Value = 10}) source2.Add(New Counter With {.Value = 20}) source2.Add(New Counter With {.Value = 30}) Dim counters As IEnumerable(Of Counter) = source2.OfType(Of Counter)() For Each counter As Counter In counters Console.WriteLine(counter.Value) Next ' Console.ReadLine() End Sub End Class ' Visit www.studyvb.com for more examples. Copyright 2003-2008 De Wolf.