01.10.2010, 21:04
(
Последний раз редактировалось RyDeR`; 09.02.2011 в 11:27.
)
Here are a few simple functions I want to share:
toUpper
This function already exist but if someone wants the function here you go:
isCharUpper
Returns true if the char is in upper case; otherwise false.
toLower
Same as toUpper.
isCharLower
Returns true if the char is in lower case; otherwise false.
toUpper
This function already exist but if someone wants the function here you go:
pawn Код:
stock toUpper(c)
{
return ('a' <= c <= 'z') ? (c += 'A' - 'a') : (c);
}
Returns true if the char is in upper case; otherwise false.
pawn Код:
stock isCharUpper(c)
{
return ('A' <= c <= 'Z');
}
Same as toUpper.
pawn Код:
stock toLower(c)
{
return ('A' <= c <= 'Z') ? (c += 'a' - 'A') : (c);
}
Returns true if the char is in lower case; otherwise false.
pawn Код:
stock isCharLower(c)
{
return ('a' <= c <= 'z');
}