NSMutableString 进阶

来源:互联网 发布:小米手机数据迁移 编辑:程序博客网 时间:2024/04/29 21:36

先无耻地贴头文件:

[javascript] view plaincopyprint?
  1. @interface NSMutableString : NSString  
  2.   
  3. /* NSMutableString primitive (funnel) method. See below for the other mutation methods. 
  4. */  
  5. - (void)replaceCharactersInRange:(NSRange)range withString:(NSString *)aString;  
  6.   
  7. @end  
  8.   
  9. @interface NSMutableString (NSMutableStringExtensionMethods)  
  10.   
  11. - (void)insertString:(NSString *)aString atIndex:(NSUInteger)loc;  
  12. - (void)deleteCharactersInRange:(NSRange)range;  
  13. - (void)appendString:(NSString *)aString;  
  14. - (void)appendFormat:(NSString *)format, ... NS_FORMAT_FUNCTION(1,2);  
  15. - (void)setString:(NSString *)aString;  
  16.   
  17. /* In addition to these two, NSMutableString responds properly to all NSString creation methods. 
  18. */  
  19. - (id)initWithCapacity:(NSUInteger)capacity;  
  20. + (id)stringWithCapacity:(NSUInteger)capacity;  
  21.   
  22. /* This method replaces all occurrences of the target string with the replacement string, in the specified range of the receiver string, and returns the number of replacements. NSBackwardsSearch means the search is done from the end of the range (the results could be different); NSAnchoredSearch means only anchored (but potentially multiple) instances will be replaced. NSLiteralSearch and NSCaseInsensitiveSearch also apply. NSNumericSearch is ignored. Use NSMakeRange(0, [receiver length]) to process whole string. If NSRegularExpressionSearch is specified, the replacement is treated as a template, as in the corresponding NSRegularExpression methods, and no other options can apply except NSCaseInsensitiveSearch and NSAnchoredSearch. 
  23. */  
  24. - (NSUInteger)replaceOccurrencesOfString:(NSString *)target withString:(NSString *)replacement options:(NSStringCompareOptions)options range:(NSRange)searchRange;  
  25.   
  26. @end  
0 0
原创粉丝点击