SyntaxFix
Write A Post
Hire A Developer
Questions
Tags
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?
This question is related to python string substring
python
string
substring
Try
isSubstring = first in theOther
string.find("substring") will help you. This function returns -1 when there is no substring.
string.find("substring")
-1
Source: Stackoverflow.com