I have a method that takes 2 string arguments. One that contains a normal string and one that contains a string with one or more wildcard characters. I've tried the following code:
Private Function DoesMatchWildcardString(ByVal fullString As String, ByVal wildcardString As String) As Boolean Dim stringParts() As String Dim matches As Boolean = True stringParts = wildcardString.Split("*") For Each str As String In stringParts If fullString.Contains(str) = False Then matches = False End If Next Return matches End Function The I realized that it won't work properly. If I have ABCD as a normal and A*CD as my wildcard string the match will work even if my normal string was CDAB, which is not what I want.
Any ideas??
Thanks a lot.
*, or more full regex-like*,+,?,., etc. ?*stands for a single character e.g.A*CD- is that true?