#include <stdio.h> #include <string.h> int strip(char * txt, char c) { int len = strlen(txt); for (int i = len - 1; i >= 0; i--) { if (txt[i] == c) { txt[i] = '\0'; } else { return len - 1 - i; } } return len; }
#include <stdio.h> #include <string.h> int strip(char * txt, char c) { int len = strlen(txt); for (int i = len - 1; i >= 0; i--) { if (txt[i] == c) { txt[i] = '\0'; } else { return len - 1 - i; } } return len; }