Anti Caps Lock
#2

try this

pawn Код:
stock low(s[])
{
    for(new i=0; s[i] != EOS; i++)
        s[i] = ((s[i] > 31) && (s[i] < 59)) ? (s[i]) : (tolower(s[i]));
}
here's an example of using it:

pawn Код:
new mystring[] = "CAPslockKK!!";

printf("before: %s",mystring);
low(mystring);
printf("after: %s",mystring);

stock low(s[])
{
    for(new i=0; s[i] != EOS; i++)
        s[i] = ((s[i] > 31) && (s[i] < 59)) ? (s[i]) : (tolower(s[i]));
}
test it here

it will output

Код:
before: CAPSlockKKK!!
after: capslockkkk!!
like this, all the charsof a string will be turned into lowercase chars, IF they were uppercase chars.
Reply


Messages In This Thread
Anti Caps Lock - by Blackazur - 22.02.2014, 12:10
Re: Anti Caps Lock - by CutX - 22.02.2014, 12:39
Re: Anti Caps Lock - by Stinged - 22.02.2014, 12:46

Forum Jump:


Users browsing this thread: 2 Guest(s)