就是从第几个字符开始找起,在这个字符前面的忽略。建议看看sun的api doc.

解决方案 »

  1.   

    喷血!!!!Returns the index within this string of the first occurrence of the specified character, starting the search at the specified index. 
    If a character with value ch occurs in the character sequence represented by this String object at an index no smaller than fromIndex, then the index of the first such occurrence is returned--that is, the smallest value k such that:  (this.charAt(k) == ch) && (k >= fromIndex)
      

  2.   

    xuetinge(薛挺) ,不是这个意思吧。
    api says:Parameters:
    str - the substring to search for.
    fromIndex - the index to start the search from.意思很明显,就是从第几个开始往后找。
      

  3.   

    public int indexOf(String str,
                       int fromIndex)
    Returns the index within this string of the first occurrence of the specified substring, starting at the specified index. The integer returned is the smallest value k for which: 
         k >= Math.min(fromIndex, str.length()) && this.startsWith(str, k)
     
    If no such value of k exists, then -1 is returned. Parameters:
    str - the substring for which to search.
    fromIndex - the index from which to start the search. 
    Returns:
    the index within this string of the first occurrence of the specified substring, starting at the specified index. 
    Throws: 
    NullPointerException - if str is null