小编tej*_*eja的帖子

如何在android中对电话号码进行验证,"以+开头"?

 Pattern p = Pattern.compile("^\\+(?:[0-9] ?){6,14}[0-9]$");
          //Match the given string with the pattern
          Matcher m = p.matcher(numberstr);
          //check whether match is found 
          boolean numberFound = m.matches();
Run Code Online (Sandbox Code Playgroud)

android

1
推荐指数
1
解决办法
3091
查看次数

标签 统计

android ×1