Using Skip While to get elements divisible by 3 : Skip « LINQ « VB.Net






Using Skip While to get elements divisible by 3

  
Imports System
Imports System.IO
Imports System.Reflection
Imports System.Linq
Imports System.Xml.Linq

Public Class MainClass
   Public Shared Sub Main
        Dim numbers() As Integer = {5, 4, 1, 3, 9, 8, 6, 7, 2, 0}
        Dim allButFirst3Numbers = From num In numbers _
                                  Skip While num Mod 3 <> 0

        Console.WriteLine("All elements starting from first element divisible by 3:")
        For Each n In allButFirst3Numbers
            Console.WriteLine(n)
        Next

   End Sub


End Class

   
    
  








Related examples in the same category

1.Using Skip to get all but the first 2
2.Using Skip to get all but the first 4 elements of the array