Loading...
Return the index of the first occurrence of needle in haystack, or -1 if not found.
sadbutsad sad
0
strStr checks if the substring needle ("sad") exists in the string haystack ("sadbutsad")needle with the first character of haystack, finding a matchneedle also match the subsequent characters in haystack, it confirms the presence of needle at the starting indexneedle is found at the beginning of the haystack