So i have this:
$('#chapters').filter(function() {
var volume_elms = $('.volume');
var chapter_elms = $('.chlist');
for (var i = 0, l = volume_elms.length; i < l; ++i) {
var elm = $(volume_elms[i]);
var celm = $(chapter_elms[i]);
var volume_name = elm.first().text();
var volume_id = elm.first().text().split('removeMe');
var vlist = {
id: volume_id,
name: volume_name,
chapters: []
};
for (var j = 0, ll = celm.children().length; j < ll; ++j) {
var chapter = $(celm.children()[j]);
var chapter_name = chapter.first().text().split('\r\n')[4].trim();
vlist.chapters.push({
name: chapter_name
});
}
json.volumes.push(vlist);
}
});
res.send(json);
And i want to remove some characters from volume_id and i know that .split('removeMe') removes that but it only removes it in that order and you can only use it once
So how can i remove multiple characters and also avoid it that it becomes an array (output is json)