Explode() function?
#3

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.
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]);
Reply


Messages In This Thread
Explode() function? - by xGoldenx - 11.01.2012, 17:15
Re: Explode() function? - by spedico - 11.01.2012, 17:20
Re: Explode() function? - by AndreT - 11.01.2012, 17:23

Forum Jump:


Users browsing this thread: 3 Guest(s)