RosettaCodeData/Task/Rot-13/Mathematica/rot-13.math
2023-07-01 13:44:08 -04:00

8 lines
160 B
Text

Rot13[s_] := StringReplace[
s,
# -> RotateLeft[#, 13] & @* CharacterRange @@ # &[
{"a", "z"}, {"A", "Z"}
] // Thread
]
Rot13["Hello World!"]
Rot13[%]