Tuesday, 9 June 2015

Validate mobile number using regular expressions in android


Here I am going to explain how to validate  Mobile number using Regular Expressions

  String Mobile="900*******";

  String MobileValid = "^[+]?[0-9]{10,13}$";

   if (Mobile.matches(MobileValid))
{
                Toast.makeText(activity, Valid, Toast.LENGTH_SHORT).show();

}
else
{
Toast.makeText(activity, InValid, Toast.LENGTH_SHORT).show();
}



Happy Coding:)