Search and Replace help!

Could anyone please instruct me as to why this code doesn’t seem to change the first letter of the replacement word to the correct format.
Everything else seems to be working.

did it like this in the end quite different but more easy to understand