1 US Dollar = 3.673 United Arab Emirates Dirham
如何3.673
从此字符串中仅获取值?
我尝试了以下代码,但没有奏效。
NSString *a = [[xmlParser array]objectAtIndex:2];
NSRange startRange = [a rangeOfString:@"="];
NSLog(@"%u",startRange.location+1);
NSRange endRange = [a rangeOfString:@" "];
NSLog(@"%u",endRange.location);
NSString *subString = [a substringWithRange:NSMakeRange(startRange.location + 1, endRange.location)];
NSLog(@"%@",subString);