Split a string
#9

Quote:
Originally Posted by GiS
Посмотреть сообщение
That's not good because I really need it. Anyone got an idea?

EDIT: And how can I check if there are 3 ":" in the string?
Loop.

Use it as so: stringCount("1:2:3", ":", 5);
pawn Код:
stock stringCount(string[], token, length)
{
    new count;
    for(new i = 0; i < length; i++)
    {
        if(string[i] == token)
            count++;
    }
    return count;
}
Reply


Messages In This Thread
Split a string - by GiS - 08.01.2011, 17:55
Re: Split a string - by Retardedwolf - 08.01.2011, 18:00
Re: Split a string - by armyoftwo - 08.01.2011, 18:05
Re: Split a string - by GiS - 08.01.2011, 18:05
Re: Split a string - by armyoftwo - 08.01.2011, 18:06
Re: Split a string - by GiS - 08.01.2011, 18:19
Re: Split a string - by armyoftwo - 08.01.2011, 18:26
Re: Split a string - by GiS - 08.01.2011, 18:32
Re: Split a string - by Krx17 - 08.01.2011, 18:43
Re: Split a string - by Mаkaveli - 08.01.2011, 18:44

Forum Jump:


Users browsing this thread: 1 Guest(s)