Format EditText view for phone numbers

后端 未结 8 1793
既然无缘
既然无缘 2020-12-28 20:49

I have an EditText view and I want it to format the user\'s input into the phone number format. For example, when the user types in 1234567890, the EditText view should dyna

8条回答
  •  萌比男神i
    2020-12-28 21:15

    I did a combination of things, i modified my input type to phone, then I used regex to remove all non numeric characters: phonenumber = phonenumber.replaceAll("\D", "");

提交回复
热议问题