Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当用户输入例如 0612345678 但在地址簿中存在此电话号码但格式为 (06) 12 34 56 78 或 +3112345678 时,我如何在用户地址簿中找到电话号码,所以基本上我的问题是......有没有办法检查电话号码,即使它有这些格式?
我研究过同样的概念。我所做的是我得到了电话号码NSString。
NSString
现在,我有一个电话号码,例如 +(999)555-8888。因此,要删除(),-和+,我只是简单地使用了NSString方法stringByReplacingOccurrencesOfString:@"(" withString:@""....and 对),-和+.
()
-
+
stringByReplacingOccurrencesOfString:@"(" withString:@""
)
最后,结果得到了 9995558888。
我想这可能会对你有所帮助.....:)