Wednesday, June 10, 2009

rtrim

Delete trailing spaces
char *rtrim(char * string)
{
while (strcmp(strrchr(string, ' '), " ") == 0) {
string[strlen(string)-1] = 0;
}
return string;
}
Googled this and can't find good solution.

No comments: