Which is StringUtils.trim. Already there. Like Dave, I'm not sure I can see converting "" to null as a highly common thing to do. In fact, I'd expect people to want the reverse more often [which I suspect Dave might like}, convert any null passed in into "".
Which is StringUtils.trim(StringUtils.defaultString(..)) or some such. A bit longwinded. Hen On Wed, 22 Jan 2003 [EMAIL PROTECTED] wrote: > > Hi, > > I'm just a lurker here, but my preference would be to return an empty > string rather than null when the string consists of just whitespace. I find > it to be annoying to always have to check for null. In fact, I very rarely > initialize a String to null, but generally initialize to "". > > Just my 2 cents, > Dave Derry > > > > > > "Leonardo > Quijano To: ><[EMAIL PROTECTED]> > Vincenzi" cc: > <lquijano@pnudcr Subject: [PATCH][LANG] >StringUtils.trimNull(String) > .com> > > 01/22/2003 01:38 > PM > Please respond > to "Jakarta > Commons > Developers List" > > > > > > I added a new method to StringUtils. It trims a string, returning null if > the string only has whitespace. > > Bug#: 13367 > > Leonardo Quijano > [EMAIL PROTECTED] > (See attached file: patchfile.txt)-- > To unsubscribe, e-mail: < > mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: < > mailto:[EMAIL PROTECTED]> > > > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>