Inactive Tutor answered 11/06/22
The directions are confusing given the sample output, but if I assume your input is a phone number in the form of a string and you want the area code printed as in your example. Here is a solution in ruby:
Lova D.
asked 11/03/22Assign number_segments with phone_number split by the hyphens.
Sample output with input: '977-555-3221'
Inactive Tutor answered 11/06/22
The directions are confusing given the sample output, but if I assume your input is a phone number in the form of a string and you want the area code printed as in your example. Here is a solution in ruby:
Get a free answer to a quick problem.
Most questions answered within 4 hours.
Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.