You can use a method str.find
with simple indexing:
>>> s="have an egg please"
>>> s[s.find('egg'):]
'egg please'
, str.find
-1
, . , , , str.find
.
>>> def slicer(my_str,sub):
... index=my_str.find(sub)
... if index !=-1 :
... return my_str[index:]
... else :
... raise Exception('Sub string not found!')
...
>>>
>>> slicer(s,'egg')
'egg please'
>>> slicer(s,'apple')
Sub string not found!