Count characters in string
#2

pawn Код:
CountChars('~', string);

stock CountChars(ch, str[], len = sizeof(str))
{
     new count;
     for(new i; i != len; i++) if(str[i] == ch) count++;
     return count;
}
Untested.
Reply


Messages In This Thread
Count characters in string - by MP2 - 23.07.2011, 21:44
Re: Count characters in string - by CaHbKo - 23.07.2011, 21:49
Re: Count characters in string - by MP2 - 23.07.2011, 21:51
Re: Count characters in string - by Jefff - 23.07.2011, 21:52
Re: Count characters in string - by CaHbKo - 23.07.2011, 21:56
Re: Count characters in string - by MP2 - 23.07.2011, 21:58

Forum Jump:


Users browsing this thread: 1 Guest(s)