Advertisement
TheKiller

Untitled

Jan 15th, 2012
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. stock str_replace(_string[], _substr[])
  2. {
  3.     new _len = strlen(_substr), _len2 = strlen(_string); //len2 is needed as strins uses sizeof which won't work for the string.
  4.     for(new x = strfind(_string, _substr); x!= -1; x = strfind(_string, _substr))
  5.     {
  6.         strdel(_string, x, x+_len);
  7.         strins(_string, _substr, x);
  8.     }
  9.     return 1;
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement