30.11.2011, 16:24
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 !!!:
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[], delim, start_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] == EOS) start_index = (-1);
return start_index;
}