There is no direct function to do that. You have to write something like this, using strchr
:
char* replace_char(char* str, char find, char replace){
char *current_pos = strchr(str,find);
while (current_pos){
*current_pos = replace;
current_pos = strchr(current_pos,find);
}
return str;
}
For whole strings, I refer to this answered question