Changes made to the code base.
- A check is made before the loop is entered to determine if the input string contains invalid characters or is null using Regex.
- The logic to shift characters is moved into a separate method. (This could be used multiple times in a larger application.)
- A StringBuilder is used as this tends to be faster than regular string concatenation.
- Using the remainder operator (%) to ensure the characters returned are between A-Z as well as creating a simple algorithm.
- Add error handling to prevent the application from terminating on exception.