说明:
在一些时候我们需要对手机号之类的做数据掩码处理,比如137****7832
代码示例
create or replace function dealPhone(phone in varchar2)
return varchar2 -- 返回处理结果
as
Result varchar2(200); --返回处理结果
begin
if(phone is null or length(phone) < 11 or (
replace(translate(phone, '0123456789', '0'), '0', '') is not null)) then
Result:=phone;
else
Result:=substr(phone, 1, 3) || '****' || substr(phone, 8, 4);
end if;
return(Result); -- 返回结果
end dealPhone;
说明:
replace(translate(phone, '0123456789', '0'), '0', '') is not null)),它为空的时候,代表phone是11位纯数字的电话号。010-12213,这个就是不纯9位的数字 本代码只掩码11位的用户手机号
其他
自己建立了一个技术群,大家愿意主动学习和分享,愿意一块实现一些有意思的技术,进行理论和实践的交流。这里面有前端和后段,不是单一的一种,方便大家沟通前后端兼容问题