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 -

how to prompt save As Box in Excel Interlop c# MVC 4 -

xslt 1.0 - How to access or retrieve mets content of an item from another item? -