showing results for - "retrieve domain from email address node js"
Gianluca
10 Jul 2017
1var email = "john.doe@email.com";
2var name   = email.substring(0, email.lastIndexOf("@"));
3var domain = email.substring(email.lastIndexOf("@") +1);
4
5console.log( name );   // john.doe
6console.log( domain ); // email.com