From: Robert Klemme Date: 2007-09-20T03:46:01+09:00 Subject: Re: special Array method about Unix pathes 2007/9/19, Sebastian Hungerecker : > Charles D Hixson wrote: > > > self.each { | x | > > > return true if path.startsWith?(x) > > > } > > > return false > > self.any? {|x| path.starts_with?(x) } You can even leave the "self." out. :-) I can think of several approaches to solve this: 1. order the array and do a second iteration where each item is checked against the last seen prefix; the idea is that every string comes before the strings that contain it as prefix. 2. insert names into a tree and output only prefixes during a tree walk. B�vue, the only issue I see with your method naming is that in Ruby methods typically use under_scores and not CamelCase as in Java. Kind regards robert