a guest Jul 22nd, 2019 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- def acronomyze(string)
- # split our sentence on space
- string_split = string.split(" ")
- string_split.map do |word|
- word # first letter of each string
- # same as:
- # letters = 
- # string_split.each do |word|
- # letters << word
- # end
- # join our array into our string
- string_together = string_split.join
- # make the string uppercase
- puts acronomyze("Away From Keyboard") == "AFK"
- puts acronomyze("Out of Offce") == "OOO"
- puts acronomyze("") == ""
- puts acronomyze("be right back") == "BRB"
RAW Paste Data