Mobile Number validation criteria:
- The first digit should contain number between 7 to 9.
- The rest 9 digit can contain any number between 0 to 9.
- The mobile number can have 11 digits also by including 0 at the starting.
- The mobile number can be of 12 digits also by including 91 at the starting
The number which satisfies the above criteria, is a valid mobile Number.
Input : Enter Mobile Number: 7873923408 Output :Valid Mobile Number Input : Enter Mobile Number: 5678729234 Output :Invalid Mobile Number
Prerequisites : Java Regular Expressions
- Check if a given string is a valid number (Integer or Floating Point) in Java
- Check if a given string is a valid number (Integer or Floating Point) in Java | SET 2 (Regular Expression approach)
- Java program to read all mobile numbers present in given file
- Check if URL is valid or not in Java
- Check if email address valid or not in Java
- Java program to check whether a string is a Palindrome
- Java program to check palindrome (using library methods)
- Valid variants of main() in Java
- Check if two arrays are permutations of each other
- Check if a File is hidden in Java
- Check for string rotation in Java
- How to check if a key exists in a HashMap in Java
- Check if a value is present in an Array in Java
- Check if two strings are same ignoring their cases
- Check if a String starts with any of the given prefixes in Java
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.