Archive for the ‘ NSCharacterSet – InvertedSet ’ Category
In order to fetch decimal digits from charater set of your NSString. You need to Trim the String then invert the set of decimal digit character set. See example below which returns value 20. NSString *mString = @”My number is 20″; NSString *digitsString = [mString stringByTrimmingCharactersInSet:[[NSCharacterSet decimalDigitCharacterSet] invertedSet]]; NSLog(@”Decimal Value: %i”, [digitsString intValue]); Happy Coding[ READ MORE ]
Enter your email address to subscribe to this blog and receive notifications of new posts by email.
Join 4 other followers
Get every new post delivered to your Inbox.