How to extract the user name from an email address in Node.js

1 Answer

0 votes
const email = 'thename@email.com';

const uname = email.split('@')[0];

console.log(uname);

  
  
  
  
/*
run:

thename
  
*/

 



answered Apr 29, 2022 by avibootz

Related questions

1 answer 176 views
1 answer 172 views
1 answer 202 views
2 answers 369 views
1 answer 162 views
1 answer 188 views
1 answer 164 views
...