iphone-common-codes-ccteam源代码 CCNSString.h
来源:互联网 发布:苹果ios6系统能用软件 编辑:程序博客网 时间:2024/06/07 00:28
//// CCNSString.h// CCFC_IPHONE//// Created by xuchen(陈旭), xichen(陈曦), qq:511272827 on 10-11-15.// Copyright 2010 cc_team. All rights reserved.//#ifndef CC_NSSTRING#define CC_NSSTRING#ifdef __OBJC__#import <Foundation/Foundation.h>#define PASCAL_STR %.*s#define LONG_LONG_INT %lld#define LONG_LONG_UINT %llu#define UNICHAR %C@interface NSString(cc)// 获取字符在字符串第一次出现的位置- (NSInteger)firstIndexOfChar:(unichar)ch;// 获取字符在字符串最后一次出现的位置- (NSInteger)lastIndexOfChar:(unichar)ch;// 获取字符在字符串第N次出现的位置, the appear count starts with 1.- (NSInteger)firstIndexOfChar:(unichar)ch withAppearCount:(NSInteger)count;// it won't modify the str, but returns another string that be trimmed.- (NSString *)returnTrimmed;// 根据字符串的字体大小获取字符串的像素长度- (CGFloat)getStrPixelLenByFontSize:(CGFloat)fontSize;// 根据字符串的字体大小获取字符串的像素高度- (CGFloat)getStrPixelHeightByFontSize:(CGFloat)fontSize;// 获取字符串中字符下标从前到后,总长度小于等于指定像素长度的最大下标的值- (NSInteger)getMaxIndexLessEqualToLen:(CGFloat)fontSize maxLen:(CGFloat)maxLen;// print each unichar - (void)print;// returns the system library path of the indicate name- (NSString *)systemLibraryPath;// returns the empty string+ (NSString *)emptyString;// returns the text char count of the string, eg, SMS's character count- (int)calculateTextCharCount;// returns the trimmed string that be trimmed not only in the beginning and end, also in the middle of the string- (NSString *)returnTrimmedEntile;// returns whether it contains the str- (BOOL)containsStr:(NSString *)str;// returns whether the string is in strArr(whether the strArr contains at least one string that is equalToString self)- (BOOL)stringInArr:(NSArray *)strArr;@end@interface NSMutableString(cc)// 移除字符串首部、尾部、首部和尾部的空白字符(Unicode形式的空格,'\t', '\n')- (void)trimBegin;- (void)trimEnd;- (void)trim;// same to trim func, but call system function- (void)trimByCallSystemFunc;@end#endif //__OBJC__#endif //CC_NSSTRING
可能有更新:
googlecode链接地址:http://code.google.com/p/iphone-common-codes-ccteam/source/browse/trunk/CCFC/files/CCNSString.h
github地址: https://github.com/cxsjabc/iphone-common-codes-ccteam/tree/master/CCFC/files/CCNSString.h
- iphone-common-codes-ccteam源代码 CCNSString.h
- iphone-common-codes-ccteam源代码 CCNSString.m
- iphone-common-codes-ccteam源代码 CCAddressBook.h
- iphone-common-codes-ccteam源代码 CCAudio.h
- iphone-common-codes-ccteam源代码 CCAutoDisappearView.h
- iphone-common-codes-ccteam源代码 CCBaseTipView.h
- iphone-common-codes-ccteam源代码 CCCALayer.h
- iphone-common-codes-ccteam源代码 CCCamera.h
- iphone-common-codes-ccteam源代码 CCCommon.h
- iphone-common-codes-ccteam源代码 CCCompile.h
- iphone-common-codes-ccteam源代码 CCConfig.h
- iphone-common-codes-ccteam源代码 CCContact.h
- iphone-common-codes-ccteam源代码 CCDebug.h
- iphone-common-codes-ccteam源代码 CCDelete.h
- iphone-common-codes-ccteam源代码 CCDepend.h
- iphone-common-codes-ccteam源代码 CCDylib.h
- iphone-common-codes-ccteam源代码 CCEmoji.h
- iphone-common-codes-ccteam源代码 CCEncoding.h
- iphone-common-codes-ccteam源代码 CCNSPredicate.m
- sqlServer基本操作
- iphone-common-codes-ccteam源代码 CCNSRegularExpression.h
- iphone-common-codes-ccteam源代码 CCNSRegularExpression.m
- 插入排序
- iphone-common-codes-ccteam源代码 CCNSString.h
- 删除d文件夹和及其下级文件夹和其中的文件(没有提示)
- iphone-common-codes-ccteam源代码 CCNSString.m
- iphone-common-codes-ccteam源代码 CCNSThread.h
- iphone-common-codes-ccteam源代码 CCNSThread.m
- ldap - 设置一个基本的OpenLDAP Server
- iphone-common-codes-ccteam源代码 CCNSTimeZone.h
- grep的用法
- iphone-common-codes-ccteam源代码 CCNSTimeZone.m