08.05.2010, 00:54
Hey guys!
I haven't seen one of these yet, & I made one a while ago to use in my scripts. It's a small stock to check if a string is empty. It works identical to the PHP function, empty, hence the same function name. It's a tad shorter than using strcmp. If someone has already done this then ignore mine, just figured someone could use it.
Usage:
&& Sorry if this is wrong section, wasn't exactly sure where to place something like this.
I haven't seen one of these yet, & I made one a while ago to use in my scripts. It's a small stock to check if a string is empty. It works identical to the PHP function, empty, hence the same function name. It's a tad shorter than using strcmp. If someone has already done this then ignore mine, just figured someone could use it.

pawn Код:
stock empty(const string[])
{
new _s=(string[0]!=0)?0:1;
return _s;
}
pawn Код:
if(!empty("test"))
{
print("full");
}
else
{
print("empty");
}

