首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > 移动开发 >

掏出字符串中的指定内容

2012-07-30 
取出字符串中的指定内容- (NSString *)CopyPartTextToString : (NSString *)SourceData FirstPlaceIndex :

取出字符串中的指定内容

- (NSString *)CopyPartTextToString : (NSString *)SourceData FirstPlaceIndex : (NSInteger) FirstPlaceIndexLastPlaceIndex : (NSInteger) LastPlaceIndex {if (FirstPlaceIndex < 1) FirstPlaceIndex = 1;if (LastPlaceIndex > [SourceData length]) LastPlaceIndex = [SourceData length];if (FirstPlaceIndex > LastPlaceIndex) return nil;NSRange range;range.location = FirstPlaceIndex - 1;range.length = LastPlaceIndex - FirstPlaceIndex + 1;return [SourceData substringWithRange:range];}

?

热点排行