Question: Write a function, named format_phone_number, that takes in a const reference to a string and returns a new string. The input string is phone number
Write a function, named "format_phone_number", that takes in a const reference to a string and returns a new string. The input string is phone number form of " XXX XXXX " where there can be whitespace before, after, and in the middle of the two parts of the local phone number. The output phone number should be an internationally valid phone number of the form "1+ (517) XXX-XXX".
I recommend using StringStreams in writing your function.
use c++
Write function, named "format_phone_number", that takes in a const reference to a string and returns a new string. The input string is phone number form of "XXX XXXX" where there can be whitespace before, after, and in the middle of the two parts of the local phone number. The output phone number should be an internationally valid phone number of the form "1 + [517] XXX-XXX". I recommend using StringStreams in writing your function. #include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
