extension method phone format with country code as parameter
- by frenchie
Hi,
I'm writing an extension method called ToPhoneFormat that formats a string of digits to phone numbers.
Is it possible to add a parameter to the method that would enable me to call it like this: MyPhoneString.ToPhoneFormat(international code)
That way, I could write MyPhoneString.ToPhoneFormat(1); to format a US phone number and MyPhoneString.ToPhoneFormat(33) to format a French phone number.
I already wrote the method that does the formatting but I'm wondering how to build the constructor so that it works with a parameter when I'm calling it.
Thanks.