Assuming the following if-statement
, when using the is
keyword with multiple OR
conditions, Is there a way to find out which condition passed the evaluation without having to check the values in separate or nested if-statements?
if (value is int xint
|| value is double xdouble
|| value is decimal xdecimal)
{
// do with value
}
Aucun commentaire:
Enregistrer un commentaire