27.06.2011, 16:13
What about this one?
pawn Code:
stock strReplace(strWhat[], strWith[], strSrc[], strDest[], bool: ignoreCase = false, destSize = sizeof(strDest))
{
new
strPos = -1,
whatLen = strlen(strWhat)
;
memcpy(strDest, strSrc, _, 1 + strlen(strSrc) << 2, destSize);
while((strPos = strfind(strDest, strWhat, ignoreCase, strPos + 1)) != -1)
{
strdel(strDest, strPos, strPos + whatLen);
strins(strDest, strWith, strPos, destSize);
}
return ;
}