new style of strtok
#1

strtok take from amxmodx

Syntax:
strtok ( const text[], Left[], leftLen, Right[], rightLen, token=' ', trimSpaces=0 )

this strtok delim left and right.

str1[] = "This *is*some text"
strtok(str1, left, 24, right, 24, '*')

Left will be "This "
Right will be "is*some text"

So I beg you if some one can help me to create such of stock

PS: like thats return not only Right !!!:
PHP код:
stock token_by_delim(const string[], return_str[], delimstart_index)
{
    new 
x=0;
    while(
string[start_index] != EOS && string[start_index] != delim) {
        
return_str[x] = string[start_index];
        
x++;
        
start_index++;
    }
    
return_str[x] = EOS;
    if(
string[start_index] == EOSstart_index = (-1);
    return 
start_index;

Reply
#2

Quote:
Originally Posted by ******
Посмотреть сообщение
Just use sscanf - it can do everything you want and more, plus it is MUCH faster than strtok.
+ i think sscanf is made in C/C++ so is more faster than pawn?
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)