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

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -