Replace a character in a string with another character | C Programming Example

preview_player
Показать описание
Рекомендации по теме
Комментарии
Автор

Kevin, your videos are Gold - many thanks to you.

fifaham
Автор

Nice, Thanks.
// Alternative method :

void replace_char(char *string, char replace, char new){
char *findout = string;
while(findout){
findout = strchr(findout, replace);
if(findout) {
*findout = new;
}
}
}

justcurious
Автор

Thanks for teaching this method, i also have another question about replacing the first and last letter of a string, how can you do that ?

xaestheticz
Автор

Hello sir, i have a question. On the void parameter you use *string, but for replace and new not using pointer ?.

Thanks sir

vino
Автор

How to replace attribute prefix value for ex: id="tit3086", id="ch863", id="bi4505" In xml file. How To replace "tit " with "tm", "ch"="coch" and "bit"="bib " only I we need replace prefix. How to solve this

basunidagundi
Автор

How to change first (second) change in string? Thanks

tetianacamomile
Автор

can i use this method to delete spaces in a string?

nunoaguiar
Автор

Is the function working if we send a char *str ?

warsoft
Автор

thank you for this video..how about we change array to string..do you have a video for that??

artaghorbani
Автор

Great video but when i hear you say char as car I died.

odiousfox
Автор

Thanks for you and translate Arabic language

omarharzallah