From: "Peña, Botp" Date: 2007-08-08T11:20:08+09:00 Subject: Re: Determining the common prefix for several strings From: Xavier Noria [mailto:fxn@hashref.com] # %w{abc acb abd acd}.abbrev.sort_by {|s,| s.length}.first.first[0..-2] # => "ac" duh, i should read further on what abrrev really does. Thanks for the enlightenment. # PS: I think abbrev does too much work compared to more specific # solutions, but it is worth exploring for the sake of thinking nonetheless. yes. this has been an enlightening thread nonetheless. kind regards -botp