I have this function: (server is a textbox field) & (domain is a textbox field)
Function foo As Boolean
System.Web.HttpContext.Current.Session("site") = "server1.example.com"
If(server.Text.ToLower.Contains((System.Web.HttpContext.Current.Session("site").ToString.Substring("."))
OR
domain.Text.ToLower.Contains((System.Web.HttpContext.Current.Session("site").ToString.Substring(".")))
Return True
Else
Return False
End If
End Function
I understand that this will not work because my string split returns a string array, which cannot be compared to the string "server.text". But how could I re-write this comparison so that I can tell if either the textbox Strings contain the session variable? Keeping in mind I don't want to use any type of iteration over an array of string values.
Expected output:
server.Text = server1
domain.Text = domain2
System.Web.HttpContext.Current.Session("site") = "server1.example.com"foo = True // server1 = server1