Message 1 of 2
Comparing text strings and not getting correct answers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi, I am comparing Text strings and not getting the list of results I want. I am using 'contains' and am looking to find all the text strings that are found in "B-ananas" using a list. The expected result should contain 4 answers because of 'contains' but I only get one result Please take a look.
here is the code....
Dim oSTr As String oSTr = "B-ananas" 'FilterName = "na" 'FilterName = "B-" 'Add Select Cases for Filter Terms Dim FilterValue As New List(Of String) ' List starts at 0 FilterValue.Add("PartName1") FilterValue.Add("B-") FilterValue.Add("xB-") FilterValue.Add("sss B- xx") FilterValue.Add("sss b- xx") Dim FilterName As String For Each FilterName In FilterValue If oSTr.Contains(FilterName) Then MsgBox("oStr = " & oSTr & ", FilterName = " & FilterName) End If Next