javascript - Removing the email extension but want to keep the "@" but ignore the yahoo.com part. Not printing out the @ sign -
//need printing out xxx@ removing yahoo.com email address
function emailsort(){ var emails = document.getelementbyid("emailtextarea").value.split("\n"); var users = [], l = emails.length, id; while (l--) if ((id = emails[l].match(/(\w+)\@/)) && (-1 === users.indexof(id[1]))) users.push(id[1]); }
try this
var v="abcd@yahoo.com"; console.log(v.split("@")[0]+'@');
Comments
Post a Comment