[#964] Bastion or SecurityManager for Ruby? — Clemens Hintze <clemens.hintze@...>

Hi,

15 messages 1999/12/10

[#989] a question about to_i — Friedrich Dominicus <Friedrich.Dominicus@...>

Sorry, I'm quite new to ruby. But I encounterd the following problem. If

17 messages 1999/12/19

[ruby-talk:00990] Re: a question about to_i

From: Yasushi Shoji <yashi@...>
Date: 1999-12-19 08:26:12 UTC
List: ruby-talk #990
From: Friedrich Dominicus <Friedrich.Dominicus@inka.de>
Subject: [ruby-talk:00989] a question about to_i
Date: Sun, 19 Dec 1999 08:42:44 +0100

> Sorry, I'm quite new to ruby. But I encounterd the following problem. If
> I have a string "bla" and apply to_i to it I get 0. This seems to be
> quite strange because it is what it is a string so shouldn't an
> exeception be rissen or s.th simular. 

I think that's because if exception is rissen you can't do like
following

s = 'whatever'
t = '0492'
u = 123

print s.to_i + t.to_i + u, "\n"

this gives you 615 no matter what s is

> And how do you check if a string is a number then?

so i guess you don't need any check.  but not sure that's what you want.

regards,
--
        yashi

In This Thread