Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # def acronymize(sentence)
- # string = ""
- # sentence.split(" ").each do |word|
- # string += word[0].upcase
- # end
- # return string
- # end
- # redo using map
- def acronymize(sentence)
- sentence.split.map { |word| word[0].upcase }.join
- end
Add Comment
Please, Sign In to add comment