01.08.2012, 10:59
Not that useful but here they're anyway:
CountUppercaseLetters - counts all the uppercase letters (if there) in a string then returns a count.
CountLowercaseLetters - counts all the lowercase letters (if there) in a string then returns a count.
CountLettersInString - counts how many letters in a string then returns a count.
CountUppercaseLetters - counts all the uppercase letters (if there) in a string then returns a count.
pawn Код:
CountUppercaseLetters(str[])
{
new ct = 0;
for(new i = 0; i < strlen(str); i ++)
{
if(str[i] >= 'A' && str[i] <= 'Z')
ct ++;
}
return ct;
}
pawn Код:
CountLowercaseLetters(str[])
{
new ct = 0;
for(new i = 0; i < strlen(str); i ++)
{
if(str[i] >= 'a' && str[i] <= 'z')
ct ++;
}
return ct;
}
pawn Код:
CountLettersInString(str[])
{
new ct = 0;
for(new i = 0; i < strlen(str); i ++)
{
if((str[i] >= 'a' && str[i] <= 'z') || (str[i] >= 'A' && str[i] <= 'Z'))
ct ++;
}
return ct;
}