SoFunction
Updated on 2025-04-09

Android programming method to find phone numbers from strings

This article describes the method of Android programming to find phone numbers from strings. Share it for your reference, as follows:

 /**
 * Find a numeric string from a string
 */
private List<String> getNumbers(String content) {
    List<String> digitList = new ArrayList<String>();
    Pattern p = ("(\\d+)");
    Matcher m = (content);
    while (()) {
      String find = (1).toString();
      (find);
    }
    return digitList;
}

For more information about Android related content, please check out the topic of this site:Android debugging skills and solutions to common problems》、《Android development introduction and advanced tutorial》、《Android multimedia operation skills summary (audio, video, recording, etc.)》、《Summary of the usage of basic Android components》、《Android View View Tips Summary》、《Android layout layout tips summary"and"Android control usage summary

I hope this article will be helpful to everyone's Android programming design.