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

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -