Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- stock str_replace(const needle[], const replace[], haystack[], bool:ignorecase = true, needlen = sizeof(needle), haylen = sizeof(haystack))
- {
- new
- count,
- index = strfind(haystack, needle, ignorecase);
- while(index != -1)
- {
- strdel(haystack, index, index + (needlen - 1));
- strins(haystack, replace, index, haylen);
- index = strfind(haystack, needle, ignorecase);
- count++;
- }
- return count;
- }
Advertisement
Add Comment
Please, Sign In to add comment