Advertisement
TheKiller

Untitled

Jan 15th, 2012
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.33 KB | None | 0 0
  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