Wriju's BLOG

.NET, Cloud and everything

VB.NET 10 : Multiline Lambdas

With implicit line continuation VB.NET 10 now allows you to write the multiline Lambdas. That means like your normal Functions you can write functions under Lambdas.


So now you may write like,


Dim arrInt As Integer() = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}


 


Dim myFinc = Array.FindAll(arrInt, Function(n)


                                       If n Mod 2 = 0 Then


                                           Console.WriteLine(“{0} is Even”, n)


                                       Else


                                           Console.WriteLine(“{0} is not Even”, n)


                                       End If


                                   End Function)


 


Namoskar!!!