Skip to content

Instantly share code, notes, and snippets.

@Solnse
Created December 15, 2012 00:41
Show Gist options
  • Save Solnse/4290028 to your computer and use it in GitHub Desktop.
Save Solnse/4290028 to your computer and use it in GitHub Desktop.
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