|
| iMatix home page | << | < | > | >> |
SFLVersion 2.10 |
#include "sflstr.h"
char *
strcrop (
char *string)
Drops trailing whitespace from string by truncating string to the last non-whitespace character. Returns string. If string is null, returns null.
{
char *last;
if (string)
{
last = string + strlen (string);
while (last > string)
{
if (!isspace (*(last - 1)))
break;
last--;
}
*last = 0;
}
return (string);
}
| | << | < | > | >> |
|