I think about how the operator is implemented in, for example
>>> s1 = 'abcdef'
>>> s2 = 'bcd'
>>> s2 in s1
True
In CPython, which algorithm is used to implement string matching, and what is the time complexity? Is there an official document or wiki about this?
source
share