Ruby Coding Exercise: Add the Next Letter or Number in a String Sequence in Ruby


In this Ruby coding exercise you’ll learn how to add the next element in a sequence of numbers or letters.


Build a method that takes in a sequenced string of letters or numbers and returns a string that contains the input string with the next element in the sequence.

Exercise File

Code File

Exercise Description

Given the following string:


Write a method that returns the next element in the string concatenated with the input string.

Sample Output


Real World Usage

String manipulation is utilized in Ruby development on a regular basis. There are some build in methods in Ruby that come close to delivering this behavior, however you need to extend their functionality to get the desired behavior.


Can be found on the solutions branch on github.


Please enter your comment!
Please enter your name here