📅  最后修改于: 2022-03-11 15:01:24.088000             🧑  作者: Mango
function hideemail(target) {
var email = target //anas.behhari@gmail.com
var hiddenEmail = "";
for (i = 0; i < email.length; i++) {
if (i > 2 && i< email.indexOf("@") ) {
hiddenEmail += "*";
} else {
hiddenEmail += email[i];
}
}
return hiddenEmail; //an.*******@gmail.com
}