> > A simple (but I fear not too efficient) way is: Not sure if OP excluded non letters from the input > > class String > > def vowels > gsub(/[^aeiou]/, '') > end > > def consonants > gsub(/[aeiou]/, '') > end > > end > > Stefano > > > This shall do it in one run, quite complicated code, interested if something more elegant can be found. class String def v_c each_char.inject(["",""]){ |r, c| case c when /[aeiouy]/i [r.first << c, r.last ] when /[^a-z]/i r else [r.first, r.last << c ] end } end end HTH Robert -- http://ruby-smalltalk.blogspot.com/ --- Whereof one cannot speak, thereof one must be silent. Ludwig Wittgenstein