Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // from expert sexchange... or was it experts exchange...
- function replaceAll( str, from, to ) {
- var idx = str.indexOf( from );
- while ( idx > -1 ) {
- str = str.replace( from, to );
- idx = str.indexOf( from );
- }
- return str;
- }
Add Comment
Please, Sign In to add comment