I am trying to write a C program to trim whitespaces before the string. But, it isn't working properly. Following is what I tried
char *lefttrim(char *str)
while(strlen(str) > 0 && str == ' ')
for(i = 1; i< strlen(str); i++)
str[i-1] = str[i];
str[strlen(str)] = '\0';
It would be great if someone can point out some mistake.