Reputation: 9866
I have a string containing values which are separated by commas within the string I want to get each value just like I would with PHP explode, but I need to do it in JavaScript. Is there a way and how can be done?
Thanks
Leron
Upvotes: 0
Views: 148
Reputation: 28722
var mystring = "I like coffee, very much so, but I don't like...";
var exploded = mystring.split(",");
window.alert(exploded[1]);
Upvotes: 0