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

python - how we can use ajax() in views.py in django? -

matlab - Using loops to get multiple values into a cell -

python - Sequence Pattern recognition with Pybrain -