' Define the delegate.
Public Delegate Function ProcessFunction(ByVal StringIn As String) As String

Module Module1

    Sub Main()
        ' Create a delegate.
        Dim MyDelegate As ProcessFunction

        ' Point the delegate to CapitalizeName()
        MyDelegate = AddressOf CapitalizeName

        ' Run CaptilizeName() through the delegate.
        Dim UCaseName As String
        UCaseName = MyDelegate("samantha jones")

        ' Display the results.
        Console.WriteLine(UCaseName)

        ' Pause before exiting.
        Console.ReadLine()
    End Sub

    Public Function CapitalizeName(ByVal Name As String) As String
        Return Name.ToUpper()
    End Function

End Module

