Advertisement
2_2002-2004 String Manipulation #126915

AWESOME String Replace

To replace a word or characters in a string, using JavaScript.

AI

Podsumowanie AI: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Kod źródłowy
original-source
function stringreplace(str,srchfor,rplwith){
	while (str.indexOf(srchfor)>-1) {
	 pos= str.indexOf(srchfor);
	 str = "" + (str.substring(0, pos) + rplwith + str.substring((pos + srchfor.length), str.length));
    }
   return str;
}
Oryginalne komentarze (3)
Odzyskane z Wayback Machine