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

pawn Код:
stock countTabulatedOccurrences(string[]) {
    new
        tCount;
       
    for(new it = 0; it < strlen(string); it++) {
        if(string[it] == '\t') tCount++;
    }
   
    return tCount;
}
Tested and works.

'\t' is not a string, it is just a single character due to the slash making it a control character.
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: 2 Guest(s)