Ruphaa's Notes

How to replace occurence of all the underscores in a string in JS

js

string.replace(/[_]/g,'') - Removes all the occurences of underscore

string.replace('\_','') - removes the first occurence of underscore