Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- stock str_replace(_string[], _substr[])
- {
- new _len = strlen(substr), _len2 = strlen(string); //len2 is needed as strins uses sizeof which won't work for the string.
- for(new x = strfind(_string, _substr); x!= -1; x = strfind(_string, _substr))
- {
- strdel(_string, x, x+_len);
- strins(_string, _substr, x);
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement