11.06.2013, 10:37
Quote:
what about checking for a slash and then replacing it?
like Код:
new pos = strfind(string, "\\", true, 0); strdel(string, pos, pos); (the \\ because a \" would cause a " not to be detected as a ":P.. so I guess \\ would work) |
To OP: Try this, I've copied it out of my GM and it works fine.
pawn Код:
stock RemoveBackslashes(const string[])
{
new ret[256];
memcpy(ret, string, _, 1024, sizeof(ret));
for (new i = 0, length = strlen(ret); i < length; i ++)
{
if (ret[i] == '\\')
{
strdel(ret, i, i + 1);
continue;
}
}
return ret;
}
pawn Код:
printf("%s", RemoveBackslashes(string));