Imagine I need to check if in
longString = "this is a long sting where a lo must be detected."
the substring lo
as a word is contained. I need to use the leading and trailing whitespace to detect it like " lo "
. How do I do this?
(To complicate matters the search string comes from a list of strings like [' lo ','bar']
.I know the solution without whitespaces like this. )