(LeetCode)Implement strStr()

原题如下:

Implement strStr().

Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.

我的代码:

public class Solution {
    public int strStr(String haystack, String needle) {
        
		if(needle.length()==0)
		{
			return 0;
		}
		if(haystack.length()


你可能感兴趣的:((LeetCode)Implement strStr())