I know how to use textfile.tostring.contains to search but how do I look for a specific word. Like, textfile.tostring.contains("bat) will result in battles and bat both being answers, how do I make only bat show up?
1 Like
does it work with toupper?
if you want to only find “bat” and not “battles” then search like this:
myString.Contains(" bat ")
What if a sentence starts with word bat
In that case how this will work buddy
myString.Contains(" bat ")
well it would be a very silly sentence, but your answer works even less
regex would be better to find in all cases:
Regex.IsMatch(MyFullTextVariable, "\b" + Regex.Escape("bat") + "\b")
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.