Problem 91. Get the area codes from a list of phone numbers

Given a string of text with phone numbers in it, return a unique'd cell array of strings that are the area codes.
s = '508-647-7000, (508) 647-7001, 617-555-1212';
then
a = {'508','617'}
Note: This problem refers to American-style phone numbers. You can assume the first three digits of a ten-digit number will always be the area code.

Solution Stats

27.69% Correct | 72.31% Incorrect
Last Solution submitted on Mar 19, 2024

Problem Comments

Solution Comments

Show comments

Problem Recent Solvers1021

Suggested Problems

More from this Author96

Problem Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!