In

    <Extension()> _
    Public Function [In](Of T)(ByVal Source As T, ByVal ParamArray List As T()) As Boolean
        For Each Value As T In List
            If Value.Equals(Source) Then
                Return True
            End If
        Next
        Return False
    End Function
Example:
Dim IsAdmin as boolean = UserName.ToLower.In("admin","administrator", "sysop")

Description

Is Object in list

Details

Double click on the code to select all.

 

;