Alternative Syntax for First Operator : First « LINQ « VB.Net






Alternative Syntax for First Operator

  


Imports System.IO
Imports System.Reflection
Imports System.Linq
Imports System.Xml.Linq
Imports System.Collections
Imports System.Collections.Generic




Public Class MainClass
    Public Shared Sub Main()

        Dim strings = New String() {"zero", "one", "two"}

        
        Dim FirstO = strings.First(Function(s) s(0) = "o"c)

        Console.WriteLine("A string starting with 'o': " & FirstO)

    End Sub


End Class

   
    
  








Related examples in the same category

1.Using First to return the first matching element
2.Element Operators First
3.Element Operators First