11.01.2012, 17:23
There are several functions like that, yes. Googling showed me a few interesting functions right away, search for name split. But if you want to go for a better solution (much faster also) that can be used in various situations (database output parsing, command parameter parsing, etc), I suggest you use sscanf (link).
Although such IP operation can be done by finding the last period mark in the string and deleting anything after it, I suppose you want support for more cases, in which sscanf will help greatly.
Although such IP operation can be done by finding the last period mark in the string and deleting anything after it, I suppose you want support for more cases, in which sscanf will help greatly.
pawn Код:
new IP[4];
sscanf(IP, "a<d>[5]", IP);
// if the version above doesn't work, refer to this
sscanf(IP, "p<.>dddd", IP[0], IP[1], IP[2], IP[3]);