Hi, Am Dienstag, 05. Jun 2007, 01:00:10 +0900 schrieb Stefan Rusterholz: > Bertram Scharpf wrote: > > Am Montag, 04. Jun 2007, 22:46:45 +0900 schrieb Stefan Rusterholz: > >> w wg wrote: > >> > How to check if a string is a integer ? > >> > >> Also you can use a regex, e.g. str =~ /\A[+-]?\d+\z/ > > > > In many cases it's useful to test for hex representations as > > well. Something like: > > In those cases I'd even more use Integer(). It accepts about all > representations of Integers ruby itself understands. Aah! I did not know that. Cool. Thanks. Bertram -- Bertram Scharpf Stuttgart, Deutschland/Germany http://www.bertram-scharpf.de