How to take N first elements from array using Linq with VB.NET

1 Answer

0 votes
Imports System
Imports System.Linq

Public Class Program
		Public Shared Sub Main()
		Dim arr As String() = {"vb.net", "c#", "c", "c++", "php", "python"}
		
			Dim result = From n In arr Take 3

    		For Each s As String In result
        		Console.WriteLine(s)
    		Next
    End Sub
End Class
		
		
		
' run:
'
' vb.net
' c#
' c
'

 



answered Mar 12, 2021 by avibootz
...