Imports System
Public Class Example
Public Shared Sub Main()
Dim letters() As String = { "E", "B", "A", "Z", "D", "X", "Y","Q" }
Console.WriteLine(Array.Exists(letters, AddressOf EndsWithS))
End Sub
Private Shared Function EndsWithS(ByVal s As String) As Boolean
If (s.Length > 5) AndAlso (s.Substring(s.Length - 6).ToLower() = "S") Then
Return True
Else
Return False
End If
End Function
End Class
|