28. Implement strStr()

来源:互联网 发布:nslookup查询域名 编辑:程序博客网 时间:2024/06/14 00:53

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) {        return haystack.indexOf(needle);    }}


原创粉丝点击