Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

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 test"
Comment

PREVIOUS NEXT
Code Example
Javascript :: vscode extensions for better react js 
Javascript :: dot env react native 
Javascript :: elasticsearch aggregation unique values 
Javascript :: timestamp convert moment vue 
Javascript :: how to set env variables in js 
Javascript :: dom full form 
Javascript :: boucle for in js 
Javascript :: object clone javascript 
Javascript :: ajaxcomplete jquery example 
Javascript :: close div when click outside angular 7 
Javascript :: javascript anagram 
Javascript :: create angular project 
Javascript :: base64 to blob 
Javascript :: regex remove spaces 
Javascript :: reverse words javascript 
Javascript :: how to export a class in node js 
Javascript :: _id to id 
Javascript :: loop through json array and get key name 
Javascript :: router.push in vue 3 
Javascript :: javascript tofixed is not a function 
Javascript :: vue 3 cdn example 
Javascript :: chartjs each dataset get colors 
Javascript :: $q.platform.is.mobile 
Javascript :: get user time using timezone javascript 
Javascript :: regex to find emails 
Javascript :: js filter out doubles 
Javascript :: javascript set class on div 
Javascript :: javascript wait for element 
Javascript :: js is undefined or null 
Javascript :: tsconfig 
ADD CONTENT
Topic
Content
Source link
Name
4+3 =