The Question :
312 people think this question is useful
I have two strings and I would like to check whether the first is a substring of the other. Does Python have such a built-in functionality?
The Question Comments :
The Answer 1
491 people think this answer is useful
in like this:
>>> x = 'hello'
>>> y = 'll'
>>> y in x
The Answer 2
53 people think this answer is useful
isSubstring = first in theOther
The Answer 3
38 people think this answer is useful
string.find("substring") will help you. This function returns
-1 when there is no substring.