Alex Rivera | Logout

How can I extract the user name from an email address using javascript?

Asked 2011-09-01T06:06:48.920
29

Given the following email address -- someone@example.com -- how can I extract someone from the address using javascript?

Thank you.

Edit
Report

1 Answer

1

string.split(separator, limit) is the method you want

"someone@example.com".split("@")[0]

answered 2011-09-01T06:09:31.937

Your Answer