Implement strStr().
Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.
偷懒用了现成的函数;indexOf
源码链接:
点击打开链接
Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.