Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
C# syntax question: switch and IndexOf
Message
De
04/05/2005 12:41:25
 
 
À
04/05/2005 12:34:50
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
C# 1.1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Divers
Thread ID:
01010821
Message ID:
01010852
Vues:
16
>Hey Alex,
>
>I think the only way you could use a switch is if you could easily strip off the country or region from the beginning of the file name. Then you could use FileName.Substring() in the switch and the types in the case. If you can't do that easily enough, then I think you're stuck with the if/else construct ... and it's not that bad really ... much easier to read than RegEx stuff!!! Also, I don't see how Enums will help either.
>
>~~Bonnie



Nope. I can't easily strip as there are several different countries and regions. It would be more trouble than it's worth. I guess I'm stuck with if..else if. Looks ugly though! Thanks!


Alex Feldstein, MCP, Microsoft MVP
VFP Tips: English - Spanish
Website - Blog - Photo Gallery


"Once again, we come to the Holiday Season, a deeply religious time that each of us observes, in his own way, by going to the mall of his choice." -- Dave Barry
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform