/**
* 对手机号码进行掩码操作
* @throws Exception
* */
public static String maskPhoneTel(String phonetel) throws TradeException
{
if(phonetel==null||"".equals(phonetel)) return "";
if(phonetel.length()!=11) throw new TradeException(TradeErrorFactory.getTradeError("1999"),"不合法的手机号码!");
return phonetel.substring(0,4)+"****"+phonetel.substring(8);
}
/**
* 银行卡掩码
* @param sCardNo
* @return
*/
public static String getYamaCardNo(String sCardNo){
String sYaMa="****************************************";
if(sCardNo==null || sCardNo.equals("")){
return sCardNo;
}else{
int iLength=sCardNo.length();
if(iLength>4){
String str2=sCardNo.substring(iLength-4, iLength);
String sYaMa1=sYaMa.substring(0,iLength-4);
return sYaMa1+str2;
}else{
return sCardNo;
}
}
}
* 对手机号码进行掩码操作
* @throws Exception
* */
public static String maskPhoneTel(String phonetel) throws TradeException
{
if(phonetel==null||"".equals(phonetel)) return "";
if(phonetel.length()!=11) throw new TradeException(TradeErrorFactory.getTradeError("1999"),"不合法的手机号码!");
return phonetel.substring(0,4)+"****"+phonetel.substring(8);
}
/**
* 银行卡掩码
* @param sCardNo
* @return
*/
public static String getYamaCardNo(String sCardNo){
String sYaMa="****************************************";
if(sCardNo==null || sCardNo.equals("")){
return sCardNo;
}else{
int iLength=sCardNo.length();
if(iLength>4){
String str2=sCardNo.substring(iLength-4, iLength);
String sYaMa1=sYaMa.substring(0,iLength-4);
return sYaMa1+str2;
}else{
return sCardNo;
}
}
}