如果我有这样的字符串:“55%”
为什么这没有选择百分比符号:
- (NSString*) stripPercentageSymbols : (NSString*) strToClean {
//check to see if the number is already formatted correctly
NSRange percentSignCheck = [strToClean rangeOfString:@"%%"];
//only strip it if it has the %
if (percentSignCheck.location != NSNotFound) {
NSLog(@"ok");
NSString* cleanedString = [strToClean substringWithRange:NSMakeRange(1, strToClean.length-2)];
return cleanedString;
}
return nil;
}