Morse Decoder - capitalized first letter of each sentence

Hi, I am currently having problem on doing the step to capitalized the letter after a period ("."). Hope to get help when iterating the string, how to apply the changes to the following letter?

Here is my code, currently I am only able to get the capitalized letter to be add after the letter but not changing it to uppercased letter.


the “a” after “.” should be replaced with capitalized “A” instead of added to behind. Seeking a way to solve it.



I’m always a little apprehensive about iterating over objects in an array while expanding it. Logically, it opens up the potential for bugs.

Consider iterating over the range of indices of the length of the original message, and then depositing the transformed elements in a new, empty “results” container (array or string).


Yes, it’s works while considering to covert it to array.

Thanks for your advice.

1 Like