Function IsThreeLetters(ByVal value As String) As Boolean
Return value.Length = 3
Dim list As List(Of String) = New List(Of String)
Dim value As String = list.Find(AddressOf IsThreeLetters)
Discussion. In the C# language, you do not need AddressOf. Instead, you can use the method name directly as the delegate. The AddressOf operator may be less confusing.
Info AddressOf introduces the context in which the method name should be referenced. The method name is just used to acquire a memory address.
Summary. The AddressOf operator references an existing Function and turns it into a delegate. We do not need to use lambda expression syntax. We can use existing functions.
Dot Net Perls is a collection of tested code examples. Pages are continually updated to stay current, with code correctness a top priority.
Sam Allen is passionate about computer languages. In the past, his work has been recommended by Apple and Microsoft and he has studied computers at a selective university in the United States.
This page was last updated on Mar 20, 2022 (rewrite).