jQuery explode string like PHP

just like PHP you can do but with different method.

var str = "How are you doing today?"
var res =  str.split(" ");

access this way : “String :” + res[0]+” “+res[1]+” “+res[4]+” “

output : How are today?

Leave a Comment