Javascript String delete(remove)

Description

Javascript String delete(remove)


String.prototype.delete = function(remove) {
 var result= '';
 for(var i=0;i<this.length;i++) {
    for (var j=0;j<remove.length;j++) {
    if(this.charAt(i) != remove.charAt(j)) {
        result += this.charAt(i)/*from w  w  w .j a  va 2s  . co m*/
    }
    }
 }
 return result
}

console.log("Hello World".delete('o'))



PreviousNext

Related