diff --git a/ruby/acronym/acronym.rb b/ruby/acronym/acronym.rb index 03af68d..b642277 100644 --- a/ruby/acronym/acronym.rb +++ b/ruby/acronym/acronym.rb @@ -1,9 +1,5 @@ class Acronym def self.abbreviate(long_name) - abbrev = "" - long_name.split(/[\W-]+/).each do |word| - abbrev += word[0] - end - abbrev.upcase + long_name.scan(/\b\w/).join.upcase end end