- 2、字符串
- (NSString)
- 1. 创建
- + (id)stringWithContentsOfFile:path encoding:env error:err
- + (id)stringWithContentsOfURL:url encoding:env error:err
- + (id)string
- + (id)stringWithString:nsstring
- - (id)initWithString:nsstring
- - (id)initWithContentsOfFile:path encoding:enc error:err
- - (id)initWithContentsOfURL:url encoding:enc error:err
- - (id)stirngWithFormat:format
- 2. 获取
- - (UNSIgned int)length;
- - (unichar)characterAtIndex:i
- - (NSString *)substringFromIndex:i
- - (NSString *)substringWithRange:range
- - (NSString *)substringToIndex:i
- 3. 操作
- - (NSComparator *)caseInsensitiveCompare:nsstring
- - (NSComparator *)compare:nsstring
- - (BOOL)isEqualToString:nsstring
- - (BOOL)hasPrefix:nsstring
- - (BOOL)hasSuffix:nsstring
- - (NSString *)capitalizedString // 返回字符串 首字母大写 其余小写
- - (NSString *)lowercaseString
- - (NSString *)uppercaseString
- - (NSString *)UTF8String
- - (double)doubleValue
- - (float)floatValue
- - (NSInteger)integerValue
- - (int)intValue
- (NSMutableString)
- 1. 创建
- + (id)stringWithContentsOfFile:path encoding:env error:err
- + (id)stringWithContentsOfURL:url encoding:env error:err
- + (id)string
- + (id)stringWithString:nsstring
- - (id)initWithString:nsstring
- - (id)initWithContentsOfFile:path encoding:enc error:err
- - (id)initWithContentsOfURL:url encoding:enc error:err
- - (id)stirngWithFormat:format
- + (id)stringWithCapacity:size
- - (id)initWithCapacity:size
- - (void)setString:nsstring
- 2. 添加
- - (void)appendString:nsstring
- - (void)insertString:nsstring atIndex:i
- - (void)replaceCharactersInRange:range withString:nsstring
- - (void)replaceOccurrencesOfString:nsstring withString:nsstring2 option:opts range:range
- 3. 删除
- - (void)deleteCharactersInRange:range
- 2. 获取
- - (UNSIgned int)length;
- - (unichar)characterAtIndex:i
- - (NSString *)substringFromIndex:i
- - (NSString *)substringWithRange:range
- - (NSString *)substringToIndex:i
- 3. 操作
- - (NSComparator *)caseInsensitiveCompare:nsstring
- - (NSComparator *)compare:nsstring
- - (BOOL)isEqualToString:nsstring
- - (BOOL)hasPrefix:nsstring
- - (BOOL)hasSuffix:nsstring
- - (NSString *)capitalizedString // 返回字符串 首字母大写 其余小写
- - (NSString *)lowercaseString
- - (NSString *)uppercaseString
- - (NSString *)UTF8String
- - (double)doubleValue
- - (float)floatValue
- - (NSInteger)integerValue
- - (int)intValue
复制代码
|
|