android - I am trying to validate my mobile number(whic I picked up form my contact list) in my registration page but it is picking up space in between it -
i trying validate mobile number picking contac list the problem that picking contact +91 95 xx xxxxxx , there space between numbers validation not happening. using validation
string mobile = "^[+]?[01]?[- .]?(\\([2-]\\d{2}\\)|[2-9]\\d{2})[- .]?\\d{3}[- .]?\\d{4}$";
but it's failure. appreciable. thank you.
replace spaces validate..
string phone=phone.replace(" ","");
now string phone has text without spaces , can compare.
Comments
Post a Comment