Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP inlist() in c#
Message
 
 
À
02/06/2008 07:58:19
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
01320903
Message ID:
01336150
Vues:
41
>I'm not passing an array as a parameter - just receiving a variable number of parameters in an array;
>
>static void doit()
>{
>	bool il = Inlist("001", "001", "002", "003");
>	Console.WriteLine("Inlist: " + il);
>}
>static bool Inlist(string s, params string[] list)
>{
>	return list.Contains(s);
>}
>
>But you're right, Contains() is less code

Ok, I would add this function to my static class. Thanks both.
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform