Java tutorial
//package com.java2s; public class Main { public static String formatPhoneNumber(String phone) { if (phone != null) { phone = phone.replace("+", "00"); phone = phone.replaceAll("[^\\d]", ""); phone = phone.replace(" ", ""); } else { phone = ""; } return phone; } }