Created
May 27, 2010 20:29
-
-
Save anonymous/416298 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 condense_by_removing(char *z_terminated, char char_to_remove) { | |
int condensed = 0; | |
for (int orig = 0; z_terminated[orig]; orig++) { | |
if (z_terminated[orig] != char_to_remove) { | |
z_terminated[condensed++] = z_terminated[orig]; | |
} | |
} | |
z_terminated[condensed] = 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment