What do you want to save?
Add Code snippet
New code examples
-
Javascript 2022-02-15 12:20:10
Javascript convert html entity to string
const htmlEntities = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&apos;" }; return str.re... Add solution -
-
Javascript 2022-02-02 21:40:59
js replace all symbols in string
function replaceAll(str, find, replace) { var escapedFind=find.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1"); return str.replace(new RegExp(escapedFind, 'g'), replace); } //usage example var sentence="How many shots did Bill t... Add solution -
Javascript 2022-02-01 21:02:06
replace many chracters js
// You can use regex to do it in only one replace // Using the or: | var str = '#this #is__ __#a test###__'; str.replace(/#|_/g,''); // result: "this is a test" // Or using the character class str.replace(/[#_]/g,''); // result: "this is a... Add solution
Best helpers
Ranking is empty