🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Help with Boolean.valueOf

#1851
From: Joi Ellis [TeamB]
Date: Fri, 24 Aug 2001 14:02
24 lines
1617 bytes
Alex Colic <alex.colic@pop-ware.com> wrote:
> Hi,

> In one of my functions I get a string back, 'Yes' or 'No'. Then I have to
> set a boolean property using that String value. I have tried
> Boolean.valueOf(theString).booleanValue but I always get false returned to
> me.

> Is there a simpler way of doing this?

Try passing back 'true' and 'false' instead of 'Yes' and 'No'.

Or you can do something like

 String result = callYourMethodHere();
 boolean foo = result.equals("Yes") ? true : false;


-- 
Joi Ellis (TeamB)               http://www.teamb.com/
No direct email, please.
For best results, post on news server newsgroups.borland.com!
Newsgroup Guidelines: http://www.borland.com/newsgroups/guide.html
Only posts which violate the rules in guide.html are subject to cancelation.
Technical Details
Message-ID: <3b865e84_2@dnews>
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!xmission!news-hog.berkeley.edu!ucberkeley!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews!not-for-mail
References: <3b865d98$1_2@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1089d0,e516bf82fe973e53
X-Google-Attributes: gid1089d0,public
X-Google-ArrivalTime: 2001-08-24 07:25:35 PST
Message-ID: <3b865e84_2@dnews>
From: "Joi Ellis [TeamB]" <joi@aravox.com>
Subject: Re: Help with Boolean.valueOf
Newsgroups: borland.public.jbuilder.java.api
References: <3b865d98$1_2@dnews>
User-Agent: tin/1.4.2-20000205 ("Possession") (UNIX) (Linux/2.2.16-3 (i686))
NNTP-Posting-Host: 209.46.41.66
Date: 24 Aug 2001 07:02:45 -0700
X-Trace: dnews 998661765 209.46.41.66 (24 Aug 2001 07:02:45 -0700)
Lines: 24
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!xmission!news-hog.berkeley.edu!ucberkeley!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews!not-for-mail