01.11.2010, 09:37
(
Последний раз редактировалось RyDeR`; 10.11.2010 в 10:24.
)
Quote:
About to test, keeping the ~ that you made since I'm to lazy to delete it.
EDIT: The space still doesn't work. |
pawn Код:
stock trimString(string[])
{
new
trimStart,
trimEnd,
inputLength = strlen(string)
;
for( ; trimStart < inputLength; ++trimStart)
{
switch(string[trimStart])
{
case '\n', '\t', '\f', '\r', ' ': continue;
default: break;
}
}
for(trimEnd = (inputLength - 1); trimEnd > trimStart; --trimEnd)
{
switch(string[trimEnd])
{
case '\n', '\t', '\f', '\r', ' ': continue;
default: break;
}
}
strmid(string, string, trimStart, (trimEnd + 1), cellmax);
return 1;
}
pawn Код:
public OnPlayerText(playerid, text[])
{
trimString(text);
return 1;
}