Answer the question
In order to leave comments, you need to log in
How to remove tab elements at the end of a line?
At the beginning, I removed it all (although it’s shitty code), but I don’t understand how to remove it at the end
int main(int argc, char *argv[])
{
char str[101] = "\t\v\n Lorem ipsum dolor sit amet, consectetur adipiscing elit.\t\v\n";
char res[101] = "";
int count = 0;
for (int i = 0; i < strlen(str); ++i)
{
if (str[i] >= 'A' && str[i] <= 'Z' || str[i] >= 'a' && str[i] <= 'z')
{
for (int j = 0; j < strlen(str); ++j)
{
res[j] = str[i];
i++;
}
break;
}
}
printf("Result: %s\n", res);
return 0;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question