Phone number format in android

前端 未结 3 1068
一向
一向 2021-01-03 14:31

In my application, I have a editText which will accept phone number from the user, My target is, as soon as user enters the phone number it should be formatted (Like by appl

3条回答
  •  不知归路
    2021-01-03 15:12

    You can use foolowing code it will work.

    String number="5129892680";
    String formattedNumber = PhoneNumberUtils.formatNumber(number);
    

提交回复
热议问题