常见的字符串裁剪,只当成笔记
//获取一个范围内的字符串
NSString* TwoStr = [urlstrsubstringWithRange:NSMakeRange(16,urlstr.length-16)];
//获取到字符 = 的范围
NSRangerange3 = [urlstrrangeOfString:@"="];
//根据某个字符对字符串分割,结果是数组
NSArray*array = [TwoStrcomponentsSeparatedByString:@"&"];//从字符&中分隔成3个元素的数组、
NSRangerange1 = [[arrayobjectAtIndex:0]rangeOfString:@"="];
NSRangerange2 = [[arrayobjectAtIndex:1]rangeOfString:@"="];
NSRangerange3 = [[arrayobjectAtIndex:2]rangeOfString:@"="];
//获取从谁以后的字符串
details.communitId= [[arrayobjectAtIndex:0]substringFromIndex:range1.location+1];