Last active
June 22, 2017 02:48
-
-
Save Yangff/817696090ef80405c03c487a96f95203 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void del_substr(char *str, const char *substr) { | |
for (int i = 0, j = 0; *str; str += !!*(substr+j)) { | |
for (j = 0; *(str+i+j) == *(substr+j) && *(substr+j); j++); | |
*str = *(str+i); | |
i += !*(substr+j) * j; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment