dimanche 5 novembre 2017

Simplifying If-conditions

Is there a way to simplify:

if(a == b || a == o || a == j || a ==....)
{
    ...
}

I thought I could do something like

if( a == (b || o || j || ...))
{
     ...
}

But that turned out to be incorrect syntax

Aucun commentaire:

Enregistrer un commentaire