From: Harry Kakueki Date: 2007-05-04T10:43:59+09:00 Subject: Re: Is there a better way to do this? > > > I am trying to come up with a "generic" formatting routine so that I > could feed it something like sform("123456789", "000-00-0000") or > sform("1234567890", "(000) 000-0000") or sform("123456", "00/00/00") and > it would work. I could easily do something like you suggest, and for > some cases it might be better, but I want something I can for any number > of formats. Thanks for the input. > > Well, that's different :) So, you want to grab the first 10 digits and ignore beyond that? Look into regular expressions. Harry -- http://www.kakueki.com/ruby/list.html A Look into Japanese Ruby List in English