现在的位置: 首页 > 综合 > 正文

android 从字符串中查找电话号码

2018年02月10日 ⁄ 综合 ⁄ 共 307字 ⁄ 字号 评论关闭

    /**
     * 从字符串中查找数字字符串
     */
    private List<String> getNumbers(String content) {  

        List<String> digitList = new ArrayList<String>();

        Pattern p = Pattern.compile("(\\d+)");

        Matcher m = p.matcher(content);
        while (m.find()) {
            String find = m.group(1).toString();
            digitList.add(find);
        }
        return digitList;
    }

抱歉!评论已关闭.