title: VB.net compare a full string to one containing wildcard characters
body: <p>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:</p>
  
  <pre><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
  </code></pre>
  
  <p>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.</p>
  
  <p>Any ideas??</p>
  
  <p>Thanks a lot.</p>