15.1k views
3 votes
To remove characters from the left of, the right of, or within a string variable, you should use the ____ function

User Trbck
by
7.4k points

1 Answer

4 votes
Answer: you should use the Remove function.

Here is C example to remove first three characters from a string with C?

void chopN(char *str, size_t n)
{ assert(n != 0 && str != 0);
size_t len = strlen(str);
if (n > len)
return; // Or: n = len;
memmove(str, str+n, len - n + 1);
User Cshion
by
8.2k points