'''
Author: 365JHWZGo
Description: 28. 实现 strStr()
Date: 2021-09-30 11:09:00
FilePath: Pythontestdemo2.py
LastEditTime: 2021-10-02 21:28:48
LastEditors: 365JHWZGo
'''
class Solution(object):
def strStr(self, haystack, needle):
"""
:type haystack: str
:type needle: str
:rtype: int
"""
if haystack=='' and needle=='':
return 0
elif haystack == '' :
return -1
elif needle == '':
return 0
else:
return haystack.find(needle)



