Javascript str.replace with regex with double searchvalue -


this question has answer here:

this code

var = '[0]'; i.replace(/\[|\]/, ''); 

returns i = '0]'

i want use .replace function converti = '0';

edit code , use g flag

var = '[0]'; i.replace(/\[|\]/g, ''); 

Comments

Popular posts from this blog

python - Selenium remoteWebDriver (& SauceLabs) Firefox moseMoveTo action exception -

html - How to custom Bootstrap grid height? -

transpose - Maple isnt executing function but prints function term -