Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- stock strreplace(str[], const find[], const rep[])
- {
- new strpos, findlen = strlen(find), replen = strlen(rep);
- LOOP:
- strpos = strfind(str, find, false, strpos);
- if(strpos == -1) goto ENDLOOP;
- strdel(str, strpos, strpos + findlen);
- strins(str, rep, strpos, replen);
- goto LOOP;
- ENDLOOP:
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement