tagged [operators]
Operator '??' cannot be applied to operands of type 'System.DateTime'
Operator '??' cannot be applied to operands of type 'System.DateTime' I get the following error : --- ``` foreach (EndServReward r in reward) { if (con.State == Connectio...
- Modified
- 27 Oct at 14:22
What does a question mark mean in C# code?
What does a question mark mean in C# code? I've seen code like the following unrelated lines: There seems to be more in C#8+ like Are all of the usages of the
How to verify whether a type overloads/supports a certain operator?
How to verify whether a type overloads/supports a certain operator? How can I check whether a certain type implements a certain operator? ``` struct CustomOperatorsClass { public int Value { get; pr...
- Modified
- 15 Dec at 16:9
Not equal to != and !== in PHP
Not equal to != and !== in PHP I've always done this: `if ($foo !== $bar)` But I realized that `if ($foo != $bar)` is correct too. Double `=` still works and has always worked for me, but whenever I s...
Why would someone use the << operator in an enum declaration?
Why would someone use the
Difference between | and || or & and && for comparison
Difference between | and || or & and && for comparison > [A clear, layman’s explanation of the difference between | and || in c# ?](https://stackoverflow.com/questions/684648/a-clear-laymans-explanat...
- Modified
- 23 May at 11:54
Does c# ?? operator short circuit?
Does c# ?? operator short circuit? When using the `??` operator in C#, does it short circuit if the value being tested is not null? Example: Does the test3 line succeed or throw a null reference excep...
- Modified
- 15 Mar at 22:36
Using the `is` operator with Generics in C#
Using the `is` operator with Generics in C# I want to do something like this: What is the best way for something like this? Note: I am not looking to constrain `T` with a `where`, but I would like my ...
How to avoid short circuit evaluation in C# while doing the same functionality
How to avoid short circuit evaluation in C# while doing the same functionality Do we have any operator in C# by which I can avoid short circuit evaluation and traverse to all the conditions. say It sh...
- Modified
- 14 Jul at 08:7
How can I obtain the element-wise logical NOT of a pandas Series?
How can I obtain the element-wise logical NOT of a pandas Series? I have a pandas `Series` object containing boolean values. How can I get a series containing the logical `NOT` of each value? For exam...
- Modified
- 12 Feb at 00:48
Not Equal to This OR That in Lua
Not Equal to This OR That in Lua I am trying to verify that a variable is NOT equal to either this or that. I tried using the following codes, but neither works: Is there a way to do this?
- Modified
- 25 Jul at 21:33
Why does >= return false when == returns true for null values?
Why does >= return false when == returns true for null values? I have two variables of type int? (or Nullable if you will). I wanted to do a greater-than-or-equal (>=) comparison on the two variables ...
- Modified
- 9 Dec at 16:36
Equality comparison between multiple variables
Equality comparison between multiple variables I've a situation where I need to check whether multiple variables are having same data such as I want to check whether x==1 and y==1 z==1 (it may be '1' ...
- Modified
- 15 Jul at 10:54
What does the question mark in member access mean in C#?
What does the question mark in member access mean in C#? Can someone please explain to me what does the question mark in the member access in the following code means? Is it part of standard C#? I get...
Is there an exponent operator in C#?
Is there an exponent operator in C#? For example, does an operator exist to handle this? In the past the `^` operator has served as an exponential operator in other languages, but in C# it is a bit-wi...
- Modified
- 19 Apr at 16:15
When to use Shift operators << >> in C#?
When to use Shift operators > in C#? I was studying shift operators in C#, trying to find out when to use them in my code. I found an answer but for Java, you could: > *4839534 * 4* can be done like t...
Meaning of () => Operator in C#, if it exists
Meaning of () => Operator in C#, if it exists I read this interesting line [here](https://stackoverflow.com/questions/3626931/method-call-overhead), in an answer by Jon Skeet. The interesting line is ...
What does a bitwise shift (left or right) do and what is it used for?
What does a bitwise shift (left or right) do and what is it used for? I've seen the operators `>>` and `
- Modified
- 14 Aug at 16:10
Bitwise operation and usage
Bitwise operation and usage Consider this code: ``` x = 1 # 0001 x
- Modified
- 25 Oct at 12:39
What is the difference between logical and conditional AND, OR in C#?
What is the difference between logical and conditional AND, OR in C#? > [What is the diffference between the | and || or operators?](https://stackoverflow.com/questions/35301/what-is-the-diffference-...
- Modified
- 23 May at 10:31
Add a negative operator(?) to a class in C#
Add a negative operator(?) to a class in C# I may not be using the right word here and that could be why I can't find the answer on my own. I have a + & - operator in my class, but I want to add a neg...
Greater than and less than in one statement
Greater than and less than in one statement I was wondering, do you have a neat way of doing this ? ``` if(orderBean.getFiles().size() > 0 && orderBean.getFiles().size() 0 && filesCount
Convert string value to operator in C#
Convert string value to operator in C# I'm trying to figure out a way to build a conditional dynamically. Here is my code so far: I did read this post, but could not figure out how to implement some o...
- Modified
- 28 Nov at 19:45
Which equals operator (== vs ===) should be used in JavaScript comparisons?
Which equals operator (== vs ===) should be used in JavaScript comparisons? I'm using [JSLint](http://en.wikipedia.org/wiki/JSLint) to go through JavaScript, and it's returning many suggestions to rep...
- Modified
- 22 Mar at 16:13