6/09/2014

115. Implement strStr()

public class Solution {
    public String strStr(String haystack, String needle) {
        int index = haystack.indexOf(needle);
        if (index<0) return null;
        else return haystack.substring(index);
    }
}

没有评论:

发表评论