次のような文字列がある場合:「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;
}