Skip to content
This repository has been archived by the owner on May 27, 2024. It is now read-only.

Latest commit

 

History

History
24 lines (15 loc) · 817 Bytes

ValidPhoneNumber.md

File metadata and controls

24 lines (15 loc) · 817 Bytes

Back to README

Day #24: Valid Phone Number

Description:

Write a function that accepts a string, and returns true if it is in the form of a phone number.

Assume that any integer from 0-9 in any of the spots will produce a valid phone number.

Only worry about the following format:

(123) 456-7890 (don't forget the space after the close parentheses)

Examples:

validPhoneNumber("(123) 456-7890")  =>  returns true
validPhoneNumber("(1111)555 2345")  => returns false
validPhoneNumber("(098) 123 4567")  => returns false