How to change to "include this" instead of "match this"?

How to change to "include this" instead of "match this"?

acadadmin3KNUF
Advocate Advocate
452 Views
2 Replies
Message 1 of 3

How to change to "include this" instead of "match this"?

acadadmin3KNUF
Advocate
Advocate

Could someone inform me how how to modify this line of iLogic code:

 

Dim part_to_find As String = "scissors_for_under_21" 

I need for this line of code to read "must INCLUDE" this bit of text as opposed to "must MATCH" this.   Thanks for your attention.

0 Likes
Accepted solutions (2)
453 Views
2 Replies
Replies (2)
Message 2 of 3

acadadmin3KNUF
Advocate
Advocate
Accepted solution

I'm not entirely sure this is a valid question...it may already be doing it and my code problems lie elsewhere.

0 Likes
Message 3 of 3

ckeveryga
Advocate
Advocate
Accepted solution

Correct, your issue is somewhere else in the code. That line only creates the string, you need to compare the string elsewhere. 

Dim strString As String = "teststring"

If strString.Contains("test") Then
	'Do stuff if string contains "test"
End If 

If strString = "test" Then
	'Do stuff if string is "test"
End 

 In this code, the first statement is true, but not the second.