Java tutorial
//package com.java2s; public class Main { public static String formatPhoneNumber(String phoneNumber) { if (phoneNumber == null) return ""; String newString = phoneNumber.replaceAll(" ", "").replaceAll("-", "").replaceAll(",", ""); return newString; } }