How do I find parts of a word in a string using an array for the keywords?
I need to run a program on computers but exclude certin users based off of the computer name. The computers naming convention is xx-yyy-Lastname. The Lastname sometimes has the users initials added to it so I need to see if I can find only part of it.
IF the computers name is DT-WAR-BISMITH and my array contains {"Walter", "Trevor", "Smith"} how would I flag this as an exclusion?
Dim computer1() As String = Split(My.Computer.Name, "-")
Dim style As String = computer1(2)
Dim Exclude() As String = {"Walter", "Trevor", "Smith"}
If Exclude.Contains(style, StringComparer.OrdinalIgnoreCase) Then
MessageBox.Show("Found on list")
End If