Comments (5)
If you format a phone number and get back the same string, then you know it is valid. But it depends on what validation you want done. For example, in the US, many formatted phone numbers come back as "(123) 456-7890". If I pass in that value for formatting, the formatted value is the same so you know it is valid. But if you want to consider "1234567890" or "123-456-7890" as valid, then I would need to add a method for validation.
from rmphoneformat.
Thanks for your quick comment.
When you format "(123) 456", you get the same "(123) 456", right? But it's obviously too short and not valid as a phone number.
Yes, I'd like to consider both "1234567890" and "123-456-7890" as valid.
On Jan 11, 2013, at 11:26 AM, rmaddy [email protected] wrote:
If you format a phone number and get back the same string, then you know it is valid. But it depends on what validation you want done. For example, in the US, many formatted phone numbers come back as "(123) 456-7890". If I pass in that value for formatting, the formatted value is the same so you know it is valid. But if you want to consider "1234567890" or "123-456-7890" as valid, then I would need to add a method for validation.
—
Reply to this email directly or view it on GitHub.
from rmphoneformat.
Yes, you are right about that format check. I will see about adding a validation method. Thanks.
from rmphoneformat.
An update has been committed. Please see the update code and the update README file for details about the new method for validation.
from rmphoneformat.
Wow! Thanks a lot!
from rmphoneformat.
Related Issues (15)
- Austrian number not properly validated HOT 3
- Was able to make it work on my project
- is it ok to use Default.phoneformat ? HOT 1
- Missing dat file HOT 2
- Formatting while editing phone number HOT 1
- Indian phone number not properly formatted and validated HOT 6
- AppStore Validation Issue HOT 1
- Is it allowed to use the private framework? HOT 3
- Add CallingCodeInfo object to public interface HOT 3
- callingCodeForCountryCode returning NULL
- Validation for some international telephone numbers not working HOT 1
- PhoneFormats.dat
- Can't find .dat file HOT 1
- Crashing on launch HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rmphoneformat.