From: David Chelimsky Date: 2008-01-04T09:41:35+09:00 Subject: Re: Finding if an array contains a data type On Jan 3, 2008 6:27 PM, Sam Phoneix wrote: > Say I wanted to see if an array contained a number or not. Would I use > the match method? > > E.g. > > x=["a","b",2, "c"] > > puts("This array contains numbers") if x.match(/\d/) Not sure if this is the simplest way, but if you're looking for actual numbers (not strings that look like numbers) you could do this: puts("This array contains numbers") if x.find {|n| Numeric === n} Cheers, David