Switch with or

  • Thread starter Thread starter Champika Nirosh
  • Start date Start date
C

Champika Nirosh

Hi All,

How can I do some thing like this in c#?

switch (value)

{

case ("decimal" || "numeric"):

{

_Type = "decimal";

}break;

}

Thanks,

Regards,

Nirosh.
 
switch (value)

{
case "decimal":
case "numeric":
{
_Type = "decimal";
break;
}
}

Chester
 
Champika said:
Hi All,

How can I do some thing like this in c#?

switch (value)

{

case ("decimal" || "numeric"):

{

_Type = "decimal";

}break;

}

Thanks,

Regards,

Nirosh.
You should be able to do something like:

switch (value)
{
case "decimal":
case "numeric":
_Type = "decimal";
break;
}
 
Back
Top