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

Popular posts from this blog

Android - Facebook GraphUser has no email attribute -

Opencart and VQMOD issue: Could not load controller in vq2-system_engine_controller.php -

overloading - Overload an event handler in C++ Builder XE5 -