0

我目前正在导出联系人内容提供程序中存储的一些联系人的电话号码,我想知道是否存在获取电话号码的“格式化”字符串,例如,而不是 xxx-xxx-xxxx => xxxxxxxxxx。以获得更好的数据库一致性。

使用正则表达式会很容易,但我想知道是否已经存在为此目的的东西,作为文档。提到:

public static final String NUMBER - Since: API Level 5
The phone number as the user **entered it**.
Type: TEXT - Constant Value: "number"

让我认为某处存在标准格式......?提前致谢 !

4

3 回答 3

0

如果您不想使用 Reg-ex 代码而不是使用下面的代码来获取这种类型的格式化数字

String[] temp=SelectedContactNo.split("-");
        String MoNo="";
        int len=temp.length;
        for(int j=0;j<len;j++)
        {
            MoNo +=temp[j];
        }

现在您将使用MoNo格式化字符串。

于 2011-09-24T07:03:31.907 回答
0

据我所知,这样的事情是不存在的。我想你必须自己写。

于 2011-05-04T15:25:47.857 回答
0

正则表达式它!很确定没有这样的东西存在。

于 2011-05-04T15:30:27.320 回答