Func(T, TResult) represents a method that has one parameter and returns one value : Lambda « Language Basics « VB.Net






Func(T, TResult) represents a method that has one parameter and returns one value

 

Delegate Function ConvertMethod(ByVal inString As String) As String

Module DelegateExample
   Public Sub Main()
      Dim convertMeth As ConvertMethod = AddressOf UppercaseString
      Dim name As String = "Dakota"
      Console.WriteLine(convertMeth(name))
   End Sub
   Private Function UppercaseString(inputString As String) As String
      Return inputString.ToUpper()
   End Function
End Module

   
  








Related examples in the same category

1.Instantiate delegate to reference method
2.Lambda Expression and Function
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.