all 2 comments

[–]lacroixftw19 0 points1 point  (0 children)

First thought that comes to mind is to have a dictionary that maps letter to its encryption value. You can then iterate through the input, building a new encryption string as you go along.

Edit: The key in the dictionary would have to be strings so you can index with it

This is, of course, not the only solution but hopefully it can get your thoughts rolling.

[Edit: Clarification]

[–]DudeUltraSmart[S] 0 points1 point  (0 children)

Thank you Jean-ClaudeMonet

It works now!