Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

retrieve domain from email address node js

var email = "john.doe@email.com";
var name   = email.substring(0, email.lastIndexOf("@"));
var domain = email.substring(email.lastIndexOf("@") +1);

console.log( name );   // john.doe
console.log( domain ); // email.com
 
PREVIOUS NEXT
Tagged: #retrieve #domain #email #address #node #js
ADD COMMENT
Topic
Name
7+5 =