假如一个 图片
"http://XXXX/ftp/upload/2016/10/28/11/5812c0f5776a2.jpg?900X616"
想得到后面的宽高 可以
-(CGSize)imgSize:(NSString *)imgPath{
CGSize sz;
NSRange range = [imgPath rangeOfString:@"?"];
if (range.location != NSNotFound) {
NSString *sub_str = [imgPath substringFromIndex:range.location+1];
NSArray *arr = [[sub_str lowercaseString] componentsSeparatedByString:@"x"];
sz.width = [arr[0] floatValue];
sz.height = [arr[1] floatValue];
return sz;
}
return CGSizeZero;
}