Hi guys !!! If you have already made the project about ‘Message Mixer’ I have a question.
After reading the code below:
I don’t understand the utility of the ‘replaceAllOccurrences’ function (line 41) because I made the following changes and It worked the same way:
I deleted the function ‘replaceAllOccurrences’ and at line 46 (that was line 48 on the first picture) I replaced the function replaceAllOccurrences by the function ‘replaceFirstOccurence’ to reuse It and It worked properly. The message has been encoded the same way.
Can you explain to me why the 'replaceAllOccurrences function was written then ?
Thank you !