Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js string replace array

String.prototype.replaceArray = function(find, replace) {
  var replaceString = this;
  for (var i = 0; i < find.length; i++) {
    replaceString = replaceString.replace(find[i], replace[i]);
  }
  return replaceString;
};
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #js #string #replace #array
ADD COMMENT
Topic
Name
7+1 =