Iam going thru a past exam paper and Iam a bit stuck, how can I solve this one:
In this question you have to write the body of a function:
A string of even length is sent to function changedString where firstly all occurrences of the
substring
es
in the first half of the string have to be deleted (erased),
secondly all occurrences of the substring
es
in the second half of the string have to be replaced with
ed
and finally the changed string has to be returned to the main function.
Thus, if the string
The lionesses saw the doves and left the pieces in the houses!
has for example been sent to the function using SenP in the parameter list, then the string
The lions saw the dov and left the pieced in the housed!
has to be returned.