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

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -