public static String phoneNumberHyphenAdd(String num, String mask) { String formatNum = ""; if (TextUtils.isEmpty(num)) return formatNum; num = num.replaceAll("-",""); if (num.length() == 11) { if (mask.equals("Y")) { formatNum = num.replaceAll("(\\d{3})(\\d{3,4})(\\d{4})", "$1-****-$3"); }else{ formatNum = num.replaceAll("(\\d{3})(\\d{3,4})(\\d{4})", "$1-$2-$3"); } }else if(num.length()==8){ fo..