Over a million developers have joined DZone.

Using Array#abbrev

DZone's Guide to

Using Array#abbrev

Free Resource
  Calculates the set of unambiguous abbreviations for the strings in self. If passed a pattern or a string, only the strings matching the pattern or starting with the string are considered. 

require 'abbrev'

%w{ car cone }.abbrev
#=> {"ca"=>"car", "con"=>"cone", "co"=>"cone", "car"=>"car", "cone"=>"cone"}

 - abbrev (Array) [apidock.com]

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}