Created
December 15, 2012 00:41
-
-
Save Solnse/4290028 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
elsif word.index("qu") #word contains 'qu'. | |
if word[0..1].include?("qu") #word begins with 'qu'. | |
result << word[2..-1] + word[0..1] + "ay" | |
else #'qu' is somewhere else in the word. | |
position = word.index("qu") | |
result << word[0..(position - 1)] + "qu" + word[(position + 2)..-1] + "ay" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment