Skip to content

Instantly share code, notes, and snippets.

@danemacaulay
Created December 14, 2017 22:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danemacaulay/f53d7213458c5b3a8994061b4c697b1a to your computer and use it in GitHub Desktop.
Save danemacaulay/f53d7213458c5b3a8994061b4c697b1a to your computer and use it in GitHub Desktop.
Set<String> phones = new HashSet<>();
PhoneNumberUtil util = PhoneNumberUtil.getInstance();
Iterator<PhoneNumberMatch> iterator = util.findNumbers(source, null).iterator();
while (iterator.hasNext()) {
phones.add(iterator.next().rawString());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment