Skip to content

Instantly share code, notes, and snippets.

@Solnse
Created December 15, 2012 01:02
Show Gist options
  • Save Solnse/4290146 to your computer and use it in GitHub Desktop.
Save Solnse/4290146 to your computer and use it in GitHub Desktop.
elsif word.include?("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] + "qu" + word[(position + 2)..-1] + "ay"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment