C
Craig S
I have something like this:
if (strVariable.BeginsWith("SOMETHING")
//whatever
if (strVariable.BeginsWith("ELSE")
//whatever
if (strVariable.BeginsWith("SomethingEvenLonger")
//whatever
Is there any way to put that in a case statement? The key to my trouble is
that the values I want to see if it begins with are all variable length so I
can't say switch (strVariable.SubString(0,10)) or similar... any ideas or do
I really have to do a bunch of 'ifs' ? (There are like 10-12 of them)
Or is there another more efficient approach?
Thanks in advance!
Craig
if (strVariable.BeginsWith("SOMETHING")
//whatever
if (strVariable.BeginsWith("ELSE")
//whatever
if (strVariable.BeginsWith("SomethingEvenLonger")
//whatever
Is there any way to put that in a case statement? The key to my trouble is
that the values I want to see if it begins with are all variable length so I
can't say switch (strVariable.SubString(0,10)) or similar... any ideas or do
I really have to do a bunch of 'ifs' ? (There are like 10-12 of them)
Or is there another more efficient approach?
Thanks in advance!
Craig