D
DiAvOl
My implementation of a trim function (It may contain bugs but it works
for me):
char *trim(char *str) {
int len;
while(isspace(*str))
str++;
len = strlen(str);
while(isspace(*(str+(--len))))
;
str[++len] = '\0';
return str;
}
for me):
char *trim(char *str) {
int len;
while(isspace(*str))
str++;
len = strlen(str);
while(isspace(*(str+(--len))))
;
str[++len] = '\0';
return str;
}