The function takes a string as input and adds an extra character at the end of the string. The extra character is the same as the character right before the end of the input string.

