lunes, mayo 17, 2010

String comparison: Equals vs Length()


   1:  //Normal Practice 
   2:  if (text!= null && text.equals("")){  
   3:       // Actions  
   4:  } 
   5:   
   6:  //Best Practice 
   7:  if (text!= null && text.length() == 0){   
   8:      // Actions 
   9:  }
LinkedinFacebookTwitterXing

blog comments powered by Disqus

Entradas populares