is Mobile number by regex - CSharp System.Text.RegularExpressions

CSharp examples for System.Text.RegularExpressions:Match Number

Description

is Mobile number by regex

Demo Code


using System.Text.RegularExpressions;
using System;//w ww  . j  a v a  2  s  .c  om

public class Main{
        public static bool isMobile(string argString)
        {
            bool flag = false;
            string argObject = argString;
            if (!Tool.isEmpty(argObject))
            {
                flag = new Regex(@"^1\d{10}$").IsMatch(argObject);
            }
            return flag;
        }
}

Related Tutorials