Lambda Expression and Function : Lambda « Language Basics « VB.Net






Lambda Expression and Function

 

Module LambdaExpression
   Public Sub Main()
      Dim convert As Func(Of String, String) = Function(s) s.ToUpper()

      Dim name As String = "aaa"
      Console.WriteLine(convert(name))  
   End Sub
End Module

   
  








Related examples in the same category

1.Func(T, TResult) represents a method that has one parameter and returns one value
2.Instantiate delegate to reference method
3.Declare a Func variable and assign a lambda expression to the variable
4.Predicate(T) Delegate represents the method that defines a set of criteria
5.Converter(TInput, TOutput) Delegate represents a method that converts an object from one type to another type.
6.Func(TResult) Delegate represents a method with no parameters returning a value of the type specified by the TResult parameter.