Re: Java programming style question
- From: David Kerber <ns_dkerber@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 4 May 2007 10:39:44 -0400
In article <op.trs3fvbv8kxvgr@xxxxxxxxxxxxxxxxxxxxx>, "Daniel Dyer"
<"You don't need it"> says...
On Fri, 04 May 2007 15:00:35 +0100, David Kerber
<ns_dkerber@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
What is the preferred way of checking for an empty string that I already
know is not Null?
Is it better (however you define that) to check for .length = 0, or
.equals( "" )?
I don't think it really matters, as long as you don't use ==. IntelliJ
Yeah, I already learned that lesson :-D
IDEA suggests using .length() for performance reasons, but I doubt it
would make any noticeable difference in most cases.
That's kind of what I figured; thanks!
.....
--
Remove the ns_ from if replying by e-mail (but keep posts in the
newsgroups if possible).
.
- References:
- Java programming style question
- From: David Kerber
- Re: Java programming style question
- From: Daniel Dyer
- Java programming style question
- Prev by Date: Re: Java programming style question
- Next by Date: Re: Java programming style question
- Previous by thread: Re: Java programming style question
- Next by thread: Re: Java programming style question
- Index(es):
Relevant Pages
|
|