diff --git a/Foundation/CPString.j b/Foundation/CPString.j index b9b0dcbe9..f72f6af15 100644 --- a/Foundation/CPString.j +++ b/Foundation/CPString.j @@ -452,6 +452,21 @@ var CPStringHashes = new objj_dictionary(); return CPOrderedSame; } +/*! + Compares the receiver to the specified string, using options in range. + @param aString the string with which to compare the range of the receiver specified by range. + @param aMask the options to use for the comparison + @param range the range of the receiver over which to perform the comparison. The range must not exceed the bounds of the receiver. + @return the result of the comparison +*/ +- (CPComparisonResult)compare:(CPString)aString options:(int)aMask range:(CPRange)range +{ + var lhs = [self substringWithRange:range], + rhs = aString; + + return [lhs compare:rhs options:aMask]; +} + /*! Returns YES if the receiver starts with the specified string. If aString