2つの文字列引数を取るメソッドがあります。1つは通常の文字列を含み、もう1つは1つ以上のワイルドカード文字を含む文字列を含みます。私は次のコードを試しました:
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
ちゃんと動かないことに気づきました。通常の文字列としてABCDを使用し、ワイルドカード文字列としてA * CDを使用している場合、通常の文字列がCDABであったとしても、一致は機能します。これは、私が望むものではありません。
何か案は??
どうもありがとう。