Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
C# syntax question: switch and IndexOf
Message
From
04/05/2005 12:41:25
 
 
To
04/05/2005 12:34:50
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
C# 1.1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01010821
Message ID:
01010852
Views:
15
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform