How to count how many '\t' a string has.
#1

I know, it's all about loops, but i couldn't manage it so that it counts correctly, this is what i have
pawn Код:
new Cmd,t,s[sizeof(Str8)];
    format( s, sizeof s, "%s", Str8 );
   
   
    for ( new x = sizeof( s ); t < x; t++ )
    {
        if ( strfind( s[ t ], "\t", false ) == 0 )
        {
            Cmd++;
            FormMessage( playerid, -1, ""CLB"%d", Cmd );
        }
    }
It does work, but gives me a big number, like 357 but i don't think the string has that much :O.
I put the message into the loop jsut for fun.
Reply


Messages In This Thread
How to count how many '\t' a string has. - by Zh3r0 - 28.01.2011, 07:31
Re: How to count how many '\t' a string has. - by __ - 28.01.2011, 10:15
Re: How to count how many '\t' a string has. - by Zh3r0 - 28.01.2011, 10:48

Forum Jump:


Users browsing this thread: 1 Guest(s)