Q:

RegExp String replace Error

i want to replace all occurrences of "+" in a string with a space
    Query = Query.replace(new RegExp("+", "g")," ");

But it raises error "SyntaxError: invalid quantifier" on above line
What i am doing wrong here?

A:

How about
Query.replace(/\+/g, "");

You will need to backslash the +

