Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript replace char if not present another character

var arr = ["pippo%12pluto%_prova", "ori%_aa"];

for (i=0; i<arr.length; i++) {
   console.log( arr[i] + ' => ' + arr[i].replace(/(^|[^'])'(?!')/g, "$1''") );
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #replace #char #present #character
ADD COMMENT
Topic
Name
1+9 =