Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using Contains with empty string
Message
De
18/07/2014 09:48:48
 
 
À
18/07/2014 09:44:11
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:
01604031
Vues:
38
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);
>
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform