You can also use regular expressions to write numbers (provided that the result is only numeric characters and spaces, and there is always the prefix "Meeting Number:"):
NSString *text = @"Please plan to attend to provide upgrade to existing code\nmorning meeting to acoomdate bum team members\nMeeting Number: 457 231 123\nTo join this meeting\n\ngo to http://domainname.com\nenter password";
NSError *error = nil;
NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:@"Meeting Number: ([0-9 ]+)" options:NSRegularExpressionCaseInsensitive error:&error];
NSArray *matches = [regex matchesInString:text
options:0
range:NSMakeRange(0, [text length])];
for (NSTextCheckingResult *match in matches) {
NSRange matchRange = [match rangeAtIndex:1];
NSString *result = [text substringWithRange:matchRange];
}
, . , :
NSTextCheckingResult *match = [regex firstMatchInString:text
options:0
range:NSMakeRange(0, [text length])];
if (match) {
NSRange matchRange = [match rangeAtIndex:1];
NSString *result = [text substringWithRange:matchRange];
}