Skip to content

Instantly share code, notes, and snippets.

@Yangff
Last active June 22, 2017 08:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Yangff/f9944276a72acb3808968a2b64139db0 to your computer and use it in GitHub Desktop.
Save Yangff/f9944276a72acb3808968a2b64139db0 to your computer and use it in GitHub Desktop.
void del_substr(char *str, const char *substr) {
for (int i = 0, j = 0; *str = *(str+i); str += !!*(substr+j), i += !*(substr+j) * j)
for (j = 0; *(str+i+j) == *(substr+j) && *(substr+j); j++);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment