How can I prevent bad inputs when storing phone numbers as strings?
问题 I am creating a phonebook program that can read VCards. The problem is with phone numbers. Normally, they will be like this in the United States: 0771234560 But if the phone number is from a foreign country, it would look like this. +94771234560 or maybe (22)772324000 Now there are + and () signs to deal with! I am currently converting phone numbers (VCards contain them as Strings) to numbers. However, if I take allow phone numbers as strings, then a user could do something crazy, like insert