carsRST
asked on
Jquery - parse a comma delimited string
Is there a way in jquery to parse a comma delimited string?
It will always only be one line of data to parse.
It will always only be one line of data to parse.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Another ref : http://www.w3schools.com/jsref/jsref_split.asp
ASKER
Thanks again!
A few comments
1) jQuery is not needed to (and afaik cannot) PARSE a comma delimited string - plain JS split(",") is the thing that does this and jQuery can then act on the resulting array..
2) jQuery map has a simpler sibling called each if you need to do something to each value.
So depending on what you need to do with the values, you may want to look into split, each and map in ascending order of complexity
1) jQuery is not needed to (and afaik cannot) PARSE a comma delimited string - plain JS split(",") is the thing that does this and jQuery can then act on the resulting array..
2) jQuery map has a simpler sibling called each if you need to do something to each value.
So depending on what you need to do with the values, you may want to look into split, each and map in ascending order of complexity