From 7311f56e1abf2938fb6ac39d29cc5e49b0229ecd Mon Sep 17 00:00:00 2001 From: newenglander Date: Wed, 2 Oct 2013 14:15:42 +0200 Subject: [PATCH] Update RMPhoneFormat.m Extra case for format: where orig doesn't have any numbers (possibly text). --- RMPhoneFormat/RMPhoneFormat.m | 3 +++ 1 file changed, 3 insertions(+) diff --git a/RMPhoneFormat/RMPhoneFormat.m b/RMPhoneFormat/RMPhoneFormat.m index 803dfe8..ed04573 100644 --- a/RMPhoneFormat/RMPhoneFormat.m +++ b/RMPhoneFormat/RMPhoneFormat.m @@ -699,6 +699,9 @@ - (CallingCodeInfo *)findCallingCodeInfo:(NSString *)str { - (NSString *)format:(NSString *)orig { // First remove all added punctuation to get just raw phone number characters. NSString *str = [RMPhoneFormat strip:orig]; + // no numbers, possibly text + if (str.length == 0) + return orig; // Phone numbers can be entered by the user in the following formats: // 1) +303