Skip to main content

Practice · 5 of 6

Caesar shift with pass-through

CHALLENGE
Difficulty: advanced+25 XP

Shift every letter **k positions forward** (wrapping: 'z' + 1 = 'a'), leaving digits, spaces, and punctuation unchanged. Case is preserved. Implement process(String s) with shift amount k = 3. Example: "Hello-World!" → "Khoor-Zruog!".

Back to lesson: Practice: String lab: transformations under constraints