Reputation: 101
If I have these phone numbers taken from my contacts in Android-Studio:
+1(354)434-777
+1444555666
I want to format them into:
354434777
444555666
How can I do this in Android-Studio/Java Automatically?
Upvotes: 0
Views: 263
Reputation: 5017
Try replace()
String number = String.valueOf(your_number.replace("+1", "").replace("(", "").replace(")", "").replace("-", "");
Upvotes: 1