04.08.2012, 11:11
(
Last edited by leonardo1434; 04/08/2012 at 11:36 AM.
Reason: forgot to add a else if, instead of a if.
)
made it quickly, it should work well.
This way is pretty simple... instead of what he did..
pawn Code:
stock check(string[],lol[])
{
for(new i = 0; i != strlen(string);++i)
{
if(!strcmp(lol,"uppercase"))
{
if(string[i] >= 'A' && string[i] <= 'Z') return printf("It has uppercase letters.");
}
else if(!strcmp(lol,"lowercase"))
{
if(string[i] >= 'a' && string[i] <= 'z') return printf("It has lowercase letters.");
}
else if(!strcmp(lol,"numbers"))
{
if(string[i] >= '0' && string[i] <= '9') return printf("It has numbers");
}
}
return 0;
}
//usage...
new blahblah[] = "abcdefkddkds2";
check(blahblah,"numbers");
new blahblah[] = "123232313FFSFFDSa";
check(blahblah,"lowercase");
new blahblah[] = "asdidsjaij123j21ij321A";
check(blahblah,"uppercase");