Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def alphabeticShift(inputString)
- string_length = inputString.length
- x = 0
- new_string = ""
- while (x < string_length)
- if inputString[x] == 'z' then
- new_string = new_string + 'a'
- else
- number = inputString[x].ord + 1
- new_string = new_string + number.chr
- end
- x = x + 1
- end
- return new_string
- end
Advertisement
Add Comment
Please, Sign In to add comment