Created
November 20, 2014 08:32
-
-
Save eladmeidar/56046313de01bc338d39 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
def proclaim | |
new_array = [] # Creating a new array to collect the words | |
string.split.each do |word| # Iterate over each word | |
new_array << "#{word}!" # add same words we are iterating over, just with an exclamation mark. | |
end | |
new_array.join(' ') # return new words array as a string | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment