javascript - RegExp String replace Error -
I want to change all occurrences of "+" in a string with a location
Query = Query.replace (New RegExp ("+", "g"), ""); But above this, "Syntax error: Invalid quantifier" raises the error Why am I wrong here?
How about
query.replace (/ \ + / G, ""); You have to backslash +
Comments
Post a Comment