What about regular expressions? When using the split method, the focus is on those parts of the line that you do not need for this task, and then another step is taken to extract the first letter of each word (chr). this is why i think regular expressions are better for this case. The node that this will also work if you have - or another special character in the string. And then, of course, you can add the .upcase method at the end to get the correct abbreviation.
string = 'something - something and something else'
string.scan(/\b\w/).join
#=> ssase
trickymuffin
source share