src/main/java/org/jboss/util/Strings.java
/**
    * Return the <i>nth</i> index of the given token occurring in the given string.
    *
    * @param string     String to search.
    * @param token      Token to match.
    * @param index      <i>Nth</i> index.
    * @return           Index of <i>nth</i> item or -1.
    */
Return the nth index of the given token occurring in the given string.
@param string     String to search.
@param token      Token to match.
@param index      Nth index.
@return           Index of nth item or -1.
Return the nth index of the given token occurring in the given string . @param string String to search . @param token Token to match . @param index Nth index . @return Index of nth item or - 1 .
public static int nthIndexOf(final String string, final String token,
      final int index)
   {
      int j = 0;
      for (int i = 0; i < index; i++)
      {
         j = string.indexOf(token, j + 1);
         if (j == -1) break;
      }
      return j;
   }
public static int nthIndexOf ( final String string , final String token , final int index ) { int j = 0 ; for ( int i = 0 ; i < index ; i ++ ) { j = string . indexOf ( token , j + 1 ) ; if ( j == - 1 ) break ; } return j ; }
Return the <i>nth</i> index of the given token occurring in the given string.
Return the <i > nth< / i > index of the given token occurring in the given string .