commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave.De...@Equifax.com
Subject Re: [PATCH][LANG] StringUtils.trimNull(String)
Date Thu, 23 Jan 2003 12:40:36 GMT

Absolutely!  Actually I have a StringUtils class with a method that I often
use:

public String safeString( String str )
{
      if( str == null )
            return "";
      else
            return str;
}

Dave D




                                                                                         
                                       
                      Henri Yandell                                                      
                                       
                      <bayard@generati         To:      Jakarta Commons Developers List
<commons-dev@jakarta.apache.org>         
                      onjava.com>              cc:                                    
                                          
                                               Subject: Re: [PATCH][LANG] StringUtils.trimNull(String)
                          
                      01/22/2003 05:06                                                   
                                       
                      PM                                                                 
                                       
                      Please respond                                                     
                                       
                      to "Jakarta                                                        
                                       
                      Commons                                                            
                                       
                      Developers List"                                                   
                                       
                                                                                         
                                       
                                                                                         
                                       




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 "".


Hen






--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message