Search code examples
androidandroid-contactsstring-parsing

Fetch only number from name number pair


We have contacts displayed as Name <123-456-767>

I want to fetch only the number part 123456767 if the specified address is a valid one.

Can anyone can help me !!!

Thanks in advance


Solution

  • public static String stripSeparators (String phoneNumber)

    Since: API Level 1 Strips separators from a phone number string. Parameters phoneNumber phone number to strip

    Returns phone string stripped of separators.