void trim(char *string){ int i; for(i=strlen(string)-1; i >= 0; i--){ if(string[i] != ' '){ string[i+1]='\0'; break; } } }