I have the following function:
listorder = listorder.replace('projectlist-','');
Problem with this is it only finds and replace the first instance and there are many. How can this be updated to Find/Replace All instances in the string?
Thanks
I have the following function:
listorder = listorder.replace('projectlist-','');
Problem with this is it only finds and replace the first instance and there are many. How can this be updated to Find/Replace All instances in the string?
Thanks
Global replace (all instances)
listorder = listorder.replace(/projectlist-/g,'');
Case-insensitive replace
listorder = listorder.replace(/projectlist-/i,'');
Global and case-insensitive
listorder = listorder.replace(/projectlist-/gi,'');