Clear[x, y, z] ToCharacterCode["abcdefghijklmnopqrstuvwxyz"]; secretMessage[s_, n_] := FromCharacterCode[ToCharacterCode[s] + n] ; secretMessage["hello world", 3] == "khoor zruog" (*Outputs false when it should be true*) secretMessage["hello world", 3]; secretMessage[%, -3] == "hello world" (*Correctly outputs as true*)
The code outputs
True. For whatever reason, the space outputs as a
"#" and I can't figure out how to make it ignore it and just go ahead with the test. I basically want the space to be ignored when I am evaluating the function.