The function transforms a given string by replacing each character with another character based on their alphabetical position.

