Hi Everyone,
I have an case in a switch that i need to run if it’s not true. I’ve tried a few things without success.
So I decided to make my first post here on Brackeys.
I’ve googled it but, I am new to programming and not sure what to google on.
I’ve tried with () and without on those below and more.
!= null // Error = “Invalid expression ‘!='”
add != null // Error = “Cannot implicitly convert type ‘bool’ to ‘string'”
!null = Error = “Operator ‘!’ cannot be applied to operand ‘<Null>'”
a few rows of my code:
private void Calculate(Nullable<int> addNum, string add) { switch(add) { case (!= null): // <---------------- This is the problem. // do something. return; case ("/"): //do something.. return; } }