如何从任何sybmbols获取kABPersonPhoneProperty的电话号码? [英] how to get phone number from kABPersonPhoneProperty with out any sybmbols?

查看:96
本文介绍了如何从任何sybmbols获取kABPersonPhoneProperty的电话号码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从地址簿获取电话号码,我正在尝试这样

i am trying to get phone number from addressbook , i am trying like this

ABMultiValueRef multi = ABRecordCopyValue(person, kABPersonPhoneProperty);
number.text = (NSString*)ABMultiValueCopyValueAtIndex(multi, 0);

但它显示的数字如(222)-456-3456

but it displaying numbers like (222)-456-3456

如何获得没有这些符号的数字() - 等等

how can i get number without those symbols ( ) - etc

提前感谢

问候

推荐答案

您可以使用NSString的方法摆脱() - 。

You can use NSString's method to get rid of ()-.

替换子字符串


  1. - stringByReplacingOccurrencesOfString:withString:

  2. - stringByReplacingOccurrencesOfString:withString:options:range:

  3. - stringByReplacingCharactersInRange:withString:

这篇关于如何从任何sybmbols获取kABPersonPhoneProperty的电话号码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆