On Thu, 23 Sep 2004, YANAGAWA Kazuhisa wrote: > In Message-Id: <4152820A.9080408 / gmx.net> > Henrik Horneber <ryco / gmx.net> writes: > >> What's the best way to test if a string only consists of whitespaces >> and newlines? > > What about this?: > > string !~ /\S/ > > where "\S" means complement of "\s". If your white spaces are not > equal to "\s", you can use an appropriate character class, say > "[^ \n]" for a character except a space and a line feed. i use this alot: if s.strip.empty? # the string is whitespace only end -a -- =============================================================================== | EMAIL :: Ara [dot] T [dot] Howard [at] noaa [dot] gov | PHONE :: 303.497.6469 | A flower falls, even though we love it; | and a weed grows, even though we do not love it. | --Dogen ===============================================================================