The below should clear it up
Dim testString As String
testString = "This is a string!"
Dim searchTerm As String
searchTerm = "string"
' Using the 'Contains' method we can
' determine if a character / string is inside
' of a different string.
' The below will return True!
MessageBox.Show(testString.Contains(searchTerm))
' here is another example.
MessageBox.Show(testString.Contains("is"))
' here is an example of what happens when you search
' for a string that isn't inside of your searchable
' string. It returns a False if it can't find it!
MessageBox.Show(testString.Contains("MegaJerk"))
Also see : msdn - String.Contain()
Another way to do this would be to use InStr()
Dim testString As String
testString = "This is a string!"
Dim searchTerm As String
searchTerm = "string"
' The below line creates a dialog box showing '11'
' the word 'string' starts at the 11th character slot
' inside of our testString variable.
MessageBox.Show(InStr(1,testString, searchTerm))
' here is another example.
MessageBox.Show(InStr(1,testString, "is"))
' here is an example of what happens when you search
' for a string that isn't inside of your searchable
' string. It returns a 0 if it can't find it!
MessageBox.Show(InStr(1,testString, "MegaJerk"))
Also see : msdn - InStr()
If my solution worked or helped you out, please don't forget to hit the kudos button 🙂iLogicCode Injector:
goo.gl/uTT1IB