C examples for String:String Function
Remove char from string
#include <stdio.h> //delete all c from s void squeeze(char s[], int c){ int i, j;//from w ww . j a va2 s. c om for (i = j = 0; s[i] != '\0'; i++) if (s[i] != c) s[j++] = s[i]; s[j] = '\0'; } int main(){ char buf[1000]; while (fgets(buf, sizeof buf, stdin) != NULL) { squeeze(buf, 'e'); squeeze(buf, 't'); printf("%s", buf); } return 0; }