Switch case looping on two strings with the same length
<p>I have a switch case that is looping on the length of different strings:
meaning </p>

<pre><code>switch(x.GetLength())
{
case 0 // means string length is 0
... and so on


}
</code></pre>

<p>The problem i am facing is that there are two strings with the same length of 6, So i will have 2 cases with the same number</p>

<p>case 6</p>

<p>case 6</p>

<p>The string in the first case comes always in the form of numbers, does not contain any Letters/ characters</p>

<p>The string in the second case comes always with character P in the beginning of the string.</p>

<p>I want to deffrentiate between the two cases: what i tried is to switch over 
(x.GetLength(), X.GetAt(0)) </p>

<p>but it gives an error that the case expression is not constant
otherwise i cannot have two cases with the same number</p>

<pre><code>switch(m_strScanned.GetLength(), X.GetAt(0)) // switch over String Length
{
case (6,2): // This case where the 6 digits are all numbers

WTN: if (m_strScanned.Mid(2,1).FindOneOf(".,/*-+ABCDEFGHIJKLMNOPQRSTUVWXYZ")&gt;=0) goto Y;
if(m_strScanned.Mid(3,1).FindOneOf(".")&gt;=0) goto X;
else
{
....
break;
}
case (6,'P'):
goto TYPE; // this is where the first digit is P

TYPE: if(m_strScanned.Mid(2,1).FindOneOf("ABCDEFGHIJKLMNOPQRSTUVWXYZ")&gt;=0)
goto Y;
if(m_strScanned.Mid(3,1).FindOneOf(".")&gt;=0) goto X;

else
{
....
break;
}
</code></pre>

<p>Is there a solution avoiding if else conditions</p>

<p>Thanks for the help</p>