26.03.2016, 02:13
strnull
Checks if the string is empty or spaced.
Return true if empty
Return false if there are some characters excluding space
Checks if the string is empty or spaced.
Return true if empty
Return false if there are some characters excluding space
pawn Код:
stock strnull(const str[])
{
if (! str[0] || (str[0] == '\1' && ! str[0]))
return true;
new len = strlen(str);
new count;
for (new i; i < len; i++)
{
if (str[i] == ' ')
count++;
}
if (count == len)
return true;
return false;
}

