I have a simple question. Using jQuery I want to extract words in a string to an arrary. How do I do this? Any examples?
e.g. If I have a string as shown below: I want to get only the words with the ‘@’ prefix
var accts = "@userA @userB @userC @userD invalidUserE @userF ";
Thanks,
K.R.
You don’t really need jQuery, you can do this quite simply with basic JavaScript:
You can do whatever you want to do with the strings as you find each one. You should also be able to use a regular expression.