Java Validation: Validating a Mobile Phone Number

preview_player
Показать описание
Java Validation: Validating a Mobile Phone Number

Greetings, today I will be teaching you how to validate a UK Mobile Phone number(similar methods can be applied for different countries but since I live in the UK I will be doing UK mobile numbers). We will check if the length is 11 digits, that all characters are digits, the first number is 0 and the second number is 7. If all are true tell the user it is valid and if at least one condition isn't true then tell the user it is invalid.

I will be uploading 1 video a day during the easter holidays so subscribe to be notified when I upload!

Social media:
Рекомендации по теме
Комментарии
Автор

return in.charAt(0) == '0' && in.charAt(1) == '7' && in.legnth() == 11 && in.matches("[0-9]+");

Thanks for the help!

Sun-Tzu-
Автор

can you do a video on the as level code exam, would be great to see how you manage time and code under the pressure.

avacadoslayer
welcome to shbcf.ru