C#隐藏手机号中间四位为*】的更多相关文章

原文:https://blog.csdn.net/yuanquanl/article/details/53519577 public static void main(String[] args) { System.out.println("18888888888".replaceAll("(\\d{3})\\d{4}(\\d{4})", "$1****$2")); } Java隐藏手机号中间四位 隐藏身份证数字 phone.replaceAll…
/** * 手机号用****号隐藏中间数字 * * @param phone * @return */public static String settingphone(String phone) { String phone_s = phone.replaceAll("(\\d{3})\\d{4}(\\d{4})", "$1****$2"); return phone_s;} /** * 邮箱用****号隐藏前面的字母 * * @return */public s…
使用正则:Regex.Replace(手机号, "(\\d{3})\\d{4}(\\d{4})", "$1****$2"); 效果:…
SELECT INSERT(mobile, 4, 4, '****')AS Mobile from Users ;…
$num = "13966778888"$str = substr_replace($num,'****',3,4);…
需求:15088881234 > 150****1234 方法1: "; , ) + , ); 方法2: "; string p2= Regex.Replace(phone "(\\d{3})\\d{4}(\\d{4})", "$1****$2"); //两种方法都可以,请随意…
Freemaker隐藏手机号,用一个取巧的方法. <#if con.phone??> ${con.phone?substring(0,3)}xxxx${con.phone?substring(7)} </#if> 先去前三位,再去7位后面的数字 Freemaker判断长度 <#if con.phone??&&con.phone?length gt 8> 注意长度这个单词不能写错…
代码: //自定义函数手机号隐藏中间四位 function get_phone($str){ $str=$str; $resstr=substr_replace($str,'****',3,4); return $resstr; } /*手机号 判断*/ function is_phone($tel){ if(preg_match("/1[23456789]{1}\d{9}$/",$tel)){ return 1; }else{ return 0; } }…
substr_replace('手机号', '****', 3, 4);…
还是老惯例,直接上代码. 最终效果图: public static class HideSensitiveInfoExtension { /// <summary> /// 隐藏敏感信息 /// </summary> /// <param name="info">信息实体</param> /// <param name="left">左边保留的字符数</param> /// <param…