Thursday, July 18, 2019

Validate mobile number in C# using regular expression

public Boolean Mobile(string str)
  {
   if (Regex.IsMatch(str, @"^[0-9]{10}$"))
   {
    return true;
   }
   else
   {
    return false;
   }
  }

1 comment:

  1. It is a great website.. The Design looks very good.. Keep working like that!. Ben Luker Australia

    ReplyDelete