Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
IsEmpty
Message
De
04/03/2010 14:07:54
Timothy Bryan
Sharpline Consultants
Conroe, Texas, États-Unis
 
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Titre:
Divers
Thread ID:
01452408
Message ID:
01452577
Vues:
36
Yup, here is the relevant portion.
/// <summary>
/// Returns a logical value indicating if the string value is empty.
/// If allowEmptyValue = true, empty means an empty string
/// If allowEmptyValue = false, empty means an empty or null string 
/// </summary>
/// <param name="value">String value</param>
/// <param name="allowEmptyValue">Specifies if an empty string is allowed</param>
/// <returns>True if empty, otherwise false</returns>
public static bool IsEmpty(string value, bool allowEmptyValue)
{
     if (allowEmptyValue)
     {
          return value == null;
     }
     else
     {
          return String.IsNullOrEmpty(value);
     }
}
>
>>Hey thanks for the response Bob. I have reviewed the help information. What I don't get is what is the meaning of "Empty"? I know what NULL is...
>>
>>A users interpretation of Empty is if they do not see any characters, then it's Empty. I tend to agree. It appears that the MM.NET framework BLG does not interprete it this way when building rules. I just hate to have to over-ride the generated code worrying that a rule for an Empty string will not indicate the string is Empty (no visible characters).
Timothy Bryan
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform