1:  private static bool IsReallyNullOrEmpty(string text)
   2:  {
   3:      return String.IsNullOrEmpty(text) || text.Trim().Length == 0;
   4:  }

 

Kommentare

#1 Jens Hofmann schrieb am Freitag, 24. April 2009 18:27:00:
Ich hab mir dafür ne Extensionmethod gebastelt:

public static bool IsNullOrTrimmedEmpty(this string strText)
{
return (strText == null) || (strText.Trim().Length == 0);
}
#2 Thomas schrieb am Freitag, 24. April 2009 19:22:00:
Japp, gute Idee. Aber dann ohne ungarische Notation ;-).
#3 Jens Hofmann schrieb am Samstag, 25. April 2009 20:03:00:
"strText" wird in der Firma so verlangt, ich hasse es! Privat mach ich den scheiss nicht :D

Dein Kommentar