JavaScript Explode
//split into array of strings.
var str = "Well, how, are , we , doing, today";
var res = str.split(",");
Grepper
//split into array of strings.
var str = "Well, how, are , we , doing, today";
var res = str.split(",");
var text = "This is a short text about StackOverflow.";
var stopwords = ['this'];
var words = text.split(/\W+/).filter(function(token) {
token = token.toLowerCase();
return token.length >= 2 && stopwords.indexOf(token) == -1;
});
console.log(words); // ["is", "short", "text", "about", "StackOverflow"]