Created
February 26, 2019 09:15
-
-
Save jshardy/9c71685784362971c59f767d53ab64fa to your computer and use it in GitHub Desktop.
Remove Control Characters
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
/********************************************************************** | |
* Function: void remove_control_characters(char *str_line) | |
* implemented for good measure | |
* Purpose: remove all control characters from a string | |
* Precondition: pass a string | |
* Postcondition: all control characters removed from string | |
************************************************************************/ | |
void remove_control_characters(char *str_line) | |
{ | |
if(str_line != NULL) | |
{ | |
while(*str_line != 0) | |
{ | |
if(((*str_line >= 1) && (*str_line <= 31)) || (*str_line == 177)) | |
*str_line = ' '; | |
str_line++; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment