在进行web前端页面开发中,有时需要从后台获取用户数据来显示在前台页面,但是考虑到用户信息安全的问题,就需要对这些信息进行处理,使其不完全显示出来,例如姓名,两个字的显示姓,名字用*代替,电话前三位和后四位显示,中间用*代替,身份证号前三位和后两位显示等等.下面我来说一下方法. 我们的方法就是将从后台获取到的数据进行字符串截取,为截取到的位数用*代替,形成这种思路之后我们可以写一个方法, 代码如下 function plusXing (str,frontLen,endLen) { var len
/* * chap 02 * ------------------------------------------------- */ create or replace function wordcount(str in varchar2) return pls_integer as words pls_integer :; ); inside_a_word boolean; begin .. loop )) or i > len then if inside_a_word then word
We are given a personal information string S, which may represent either an email address or a phone number. We would like to mask this personal information according to the following rules: 1. Email address: We define a name to be a string of length