Link Search Menu Expand Document

Caesar Cipher

For a given string text consisting of lowercase english letters and integer shift print the encoded string using the Ceasar Cipher. I.e. replace each plaintext letter with the one that is shift number of places down the alphabet.

E.g. for the following inputs:

var text = "attackatonce";
var shift = 3;

The program should ouput xqqxzhxqlkzb