Working through the TOP section on Ruby fundamentals, the first project to work on is to create a caesar cipher.
We have to have a function such that:
- A user can pass a string through with punctuation and a shift count
- The function will modify only alphabet characters
[a-z][A-Z]
ignoring punctuation and space characters - The function will wrap the character shift from
z
toa
andZ
toA
when shifting past the end of the alphabet - The function will not change the case of the characters
>caesar_cipher("What a string!", 5)
=> "Bmfy f xywnsl!"