How do I strip out the words after the @? for example if string is
12 @ 8.97 MB
then the output would become
12
How to do this in javascript?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
just
splitit, if there is no@char, it’ll just return an array of 1 string, if there was an@, everything that preceded the@, will be assigned to the first (0) index of the resulting array. In other words:It doesn’t matter if the string contained 0 or 1000 at signs, this will work