SA-MP Forums Archive
Removing an extension using strdel. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Removing an extension using strdel. (/showthread.php?tid=539602)



Removing an extension using strdel. - Crayder - 28.09.2014

I thought I could use strdel starting at the beginning of the extension and ending at the length of the filename... However,

This doesn't remove the extension:
pawn Код:
if(strfind(item, ".ini") != -1)
{
    strdel(item, item[strfind(item, ".ini")], item[strlen(item)]);
    format(line, sizeof(line), "%s\n%s", item, line);
    fcount++;
}
How do i remove the extension!

Ahead of time, thanks to all for any help!


Re: Removing an extension using strdel. - Jefff - 29.09.2014

pawn Код:
strdel(item, strfind(item, ".ini"), strlen(item));