Function Kata "ROT-13"

Write a function that creates a text using the method ROT-13 encrypted.

With ROT-13, each letter of the text to be encrypted is replaced by the letter that is 13 characters further back in the alphabet. If you reach beyond the end of the alphabet, the process continues at the beginning.

Example: Hello, World -> URYYB, JBEYQ

e" becomes "R" and "W" becomes "J". Lower-case letters are converted to upper-case letters.

Umlauts must be replaced by letter combinations before encoding: "Ö" = "OE", "Ä" = "AE", "Ü" = "UE", "ß" = "SS".

Characters that are not letters are not encrypted.

Variation #1

Make the offset (here: 13) variable.

Variation #2

Also encrypt digits. Assume that digits and capital letters form a unit: 0123456789ABCDEFGH...XYZ.

0" then becomes "D" with offset 13 and "Z" no longer becomes "M" but "C".

en_USEnglish