Article View: aus.computers.java
Article #318Re: Help! String as Integer
From: Paul Murray
Date: Fri, 01 Jun 2001 15:05
Date: Fri, 01 Jun 2001 15:05
46 lines
2429 bytes
2429 bytes
See java.text.ChoiceFormat .
--
--------------------------------------------------------------
Sometimes he answers "Yes", sometimes "No", sometimes "Wait", and sometimes
he gives you something different.
You get the same set of responses praying to a rock.
http://www.users.bigpond.com/pmurray
ICQ: 26066755
"rastgoo" <rastgoo@thefreeinternet.co.uk.NOSPAM> wrote in message
news:3b16b1bd_3@news.bizonline.net...
>
> Luke Vanderfluit <luke@chipcity.com.au> wrote in message
> news:3A63FC90.3C832EFA@chipcity.com.au...
> > Hi
> >
> > I need help with this.
> > Why doesn't the following code work?:
> > I need to interpret a line of text as an integer.
> >
> > String a = "yes";
> > String b = "ls";
> > int aa = Integer.valueOf("foo").intValue();
> > int bb = Integer.valueOf("bar").intValue();
> > System.out.println(aa);
> > System.out.println(bb);
> >
> > This throws a NumberFormatException
> >
> > How can I read a String as an Integer
> >
> > Can you help me please.
> >
> > Desperate,
> > --
> > Luke Vanderfluit
> >
> > Phone 61 8 8556 6112
> >
> > Aldinga Beach, South Australia
> >
> >
> >
>
>
Technical Details
Message-ID:
<NEYR6.31881$hV3.53039@newsfeeds.bigpond.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!intgwpad.nntp.telstra.net!newsfeeds.bigpond.com!not-for-mailReferences:
<3A63FC90.3C832EFA@chipcity.com.au> <3b16b1bd_3@news.bizonline.net>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 113ae9,7de64e08ee658586 X-Google-Attributes: gid113ae9,public X-Google-Thread: 10d6db,7de64e08ee658586 X-Google-Attributes: gid10d6db,public X-Google-Thread: 10a146,5f124143cc4771e2 X-Google-Attributes: gid10a146,public X-Google-ArrivalTime: 2001-06-01 20:14:18 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!intgwpad.nntp.telstra.net!newsfeeds.bigpond.com!not-for-mail From: "Paul Murray" <pmurray@nospam.bigpond.com> Newsgroups: aus.computers.java,comp.lang.java.programmer,comp.lang.java.help References: <3A63FC90.3C832EFA@chipcity.com.au> <3b16b1bd_3@news.bizonline.net> Subject: Re: Help! String as Integer Lines: 48 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.3018.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.3018.1300 Message-ID: <NEYR6.31881$hV3.53039@newsfeeds.bigpond.com> Date: Sat, 2 Jun 2001 01:05:44 +1000 NNTP-Posting-Host: 203.54.250.193 X-Trace: newsfeeds.bigpond.com 991450797 203.54.250.193 (Sat, 02 Jun 2001 12:59:57 EST) NNTP-Posting-Date: Sat, 02 Jun 2001 12:59:57 EST Organization: Telstra BigPond Internet Services (http://www.bigpond.com)