Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using Contains with empty string
Message
De
18/07/2014 09:50:56
 
 
À
18/07/2014 09:48:48
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
VB 9.0
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01604011
Message ID:
01604036
Vues:
34
Hmm. That would have to be IsEmptyOrIsContainedBy :-}

>Or IsEmptyOrContains to be consistent with current methods.
>
>>I guess you're right. It would me more consistent with other String methods. TBH I don't really like either in that they are not truly descriptive of what the method does :-{
>>
>>Maybe swap it around :
public static bool IsEmptyOrIn(this String str, string longsString)
>>        {
>>            return string.IsNullOrEmpty(str) || longsString.Contains(str);
>>        }
>>       // with
>>      var x = ShortString.IsEmptyOrIn(LongString);
>>
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform