🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.api
Article #3125

Re: how to convert string to integer??

#3125
From: Rich Wilkman
Date: Thu, 14 May 1998 00:00
50 lines
1894 bytes
Scott:

You need to pick up a good basic Java reference like Java in a
Nutshell -- this has nothing to do with JBuilder at all.

From String to Integer.

Assuming that String x is a string representation of something that
can be an Integer (i.e, a non-decimal value within the range of
Integer), then you should use the standard Integer constructor that
takes a String argument.

Something like:

try{
   String x = "999";
   Integer y = new Integer(x);
}
catch(NumberFormatException){
 // you need this because this exception will be thrown if someone
 // tries to make an Integer out of some non-numeric String like
"Scott"
 // how you handle the exception is up to you
}

-Rich

Scott Garrison wrote:
> 
> how to convert string to integer??      integer to string easy enough.
> 
> stupid question but Jbuilder Doc SUCKS!
> 
> thx

-- 

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Rich Wilkman
Senior Quality Assurance Engineer
Borland JBuilder Team

If you see something that looks like an opinion up there,
it's mine and mine alone.

Mail sent to me from the newsgroups won't bounce but will
be ignored.  If I have time, I'll respond, but you  have
a better chance if you confine your posts to the newsgroups
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Technical Details
Message-ID: <355B2003.8878370F@corp.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <355B0425.6DD20343@mindspring.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1089d0,733133ccd186a4c8
X-Google-Attributes: gid1089d0,public
From: Rich Wilkman <rwilkman@corp.borland.com>
Subject: Re: how to convert string to integer??
Date: 1998/05/14
Message-ID: <355B2003.8878370F@corp.borland.com>
X-Deja-AN: 353242870
Content-Transfer-Encoding: 7bit
References: <355B0425.6DD20343@mindspring.com>
Content-Type: text/plain; charset=us-ascii
Organization: Another Netscape Collabra Server User
Mime-Version: 1.0
Newsgroups: borland.public.jbuilder.java.api