src/main/java/org/jboss/util/Strings.java
/**
    * Return the range from a begining token to an ending token.
    *
    * @param beginToken String to indicate begining of range.
    * @param endToken   String to indicate ending of range.
    * @param string     String to look for range in.
    * @param fromIndex  Beginning index.
    * @return           (begin index, end index) or <i>null</i>.
    */
Return the range from a begining token to an ending token.
@param beginToken String to indicate begining of range.
@param endToken   String to indicate ending of range.
@param string     String to look for range in.
@param fromIndex  Beginning index.
@return           (begin index, end index) or null.
Return the range from a begining token to an ending token . @param beginToken String to indicate begining of range . @param endToken String to indicate ending of range . @param string String to look for range in . @param fromIndex Beginning index . @return ( begin index end index ) or null .
public static Range rangeOf(final String beginToken, final String endToken,
      final String string, final int fromIndex)
   {
      int begin = string.indexOf(beginToken, fromIndex);
      if (begin != -1)
      {
         int end = string.indexOf(endToken, begin + 1);
         if (end != -1)
         {
            return new Range(begin, end);
         }
      }
      return null;
   }
public static Range rangeOf ( final String beginToken , final String endToken , final String string , final int fromIndex ) { int begin = string . indexOf ( beginToken , fromIndex ) ; if ( begin != - 1 ) { int end = string . indexOf ( endToken , begin + 1 ) ; if ( end != - 1 ) { return new Range ( begin , end ) ; } } return null ; }
Return the range from a begining token to an ending token.
Return the range from a begining token to an ending token .