Advertisement
Guest User

Untitled

a guest
Jul 25th, 2014
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2.     this.strreplace = function(searchstr,replacestr){
  3.         var ind = this.value.indexOf(searchstr);
  4.         var newstr="";
  5.         var temp = replacestr;
  6.         var lastind = ind + searchstr.length;
  7.         for(var i =0;i<ind;i++)
  8.             newstr+=this.value[i];
  9.         newstr += replacestr;
  10.         for(var j = lastind;j<this.strlen;j++)
  11.             newstr+= this.value[j];
  12.         return newstr;
  13.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement