Skip to content

Instantly share code, notes, and snippets.

Created May 27, 2010 20:29
Show Gist options
  • Save anonymous/416298 to your computer and use it in GitHub Desktop.
Save anonymous/416298 to your computer and use it in GitHub Desktop.
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