Hey all, looking to reduce the code on my c# if statements as there are several repeating factors and was wondering if a trimmer solution is possible.
I currently have 2
I always try to factor out complex boolean expressions into meaningful variables (you could probably think of better names based on what these columns are used for):
bool notColumnsABC = (columnname != a && columnname != b && columnname != c);
bool notColumnA2OrBoxIsChecked = ( columnname != A2 || checkbox.checked );
if ( notColumnsABC
&& notColumnA2OrBoxIsChecked )
{
"statement 1"
}