Reputation: 9804
I have this String :
var test = "[email protected]";
I would like to replace all character after the "@" character by empty value. I would like to get this String :
var test = "toto"
Upvotes: 2
Views: 53
Reputation: 5332
"[email protected]".replace(/@.+$/, '')
Upvotes: 0
Reputation: 2097
Try this:
test= test.split('@')[0]