From: Robert Klemme Date: 2004-09-23T23:59:32+09:00 Subject: Re: whitespace string only "ts" schrieb im Newsbeitrag news:200409231451.i8NEphE08333@moulon.inra.fr... > >>>>> "A" == Ara T Howard writes: > > A> if s.strip.empty? > A> # the string is whitespace only > > svg% ruby -e 'a = " \000\000"; p "OK" if a.strip.empty?' > "OK" > svg% > > svg% ruby -e 'a = " \000\000 "; p "OK" if a.strip.empty?' > svg% Also I'd say the disadvantage of "a.strip.empty?" is that it creates a copy of the string (=> a new instance) which is generally slower than a simple regexp check. Kind regards robert