/**
* 전화번호(핸드폰번호)에 구분자를 추가
* @param phoneNumber : 전화번호
* @param str : 구분자
* */
public String convertPhoneNumber(String phoneNumber, String str) {
try{
if (phoneNumber == null) {
return "";
}
if (phoneNumber.length() == 8) {
return phoneNumber.replaceFirst("^([0-9]{4})([0-9]{4})$", "$1" + str + "$2");
} else if (phoneNumber.length() == 12) {
return phoneNumber.replaceFirst("(^[0-9]{4})([0-9]{4})([0-9]{4})$", "$1"+ str + "$2"+ str +"$3");
}
return phoneNumber.replaceFirst("(^02|[0-9]{3})([0-9]{3,4})([0-9]{4})$", "$1"+ str +"$2"+ str +"$3");
}catch (Exception e){
log.error(e.toString());
return phoneNumber;
}
}