Classic ASP – IN ARRAY

Function InArray(Needle, Haystack)
    Dim i, x
    InArray = False

    For i = 0 To Ubound(Haystack)
        If IsArray(Needle) = True Then
            For x = 0 To Ubound(Needle)
                If Trim(Haystack(i)) = Trim(Needle(x)) Then
                    InArray = True
                    Exit Function
                End If
            Next
        Else
            If Trim(Haystack(i)) = Trim(Needle) Then
                InArray = True
                Exit Function
            End If
        End If
    Next
End Function

SOURCE: https://gist.github.com/gwobcke/1044367


Comments are closed.