mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-16 21:41:18 +00:00
implement NSString compare:options:range
Thanks to Cacaodev for the ticket and initial stab at this. [#105 state:resolved milestone:0.6]
This commit is contained in:
1 parent
9b764caf79
commit
88f12bad93
1 file changed
+15
@@ -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 <code>YES</code> if the receiver starts
|
||||
with the specified string. If <code>aString</code>
|
||||
|
||||
Reference in new issue
Block a user