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...

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

9 Jul at 20:42

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...

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...

12 Dec at 19:19

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...

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...

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 ...

16 Apr at 04:36

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...

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...

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?

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 ...

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' ...

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...

1 Oct at 13:35

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...

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...

3 May at 02:53

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 ...

23 May at 12:18

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 `

Using a custom F# operator in C#?

Using a custom F# operator in C#? I've stumbled upon the fact that it's possible to define custom operators in F#. Also, I believe it's possible to reuse F# code in C#. Is it possible to create a cust...

9 Apr at 05:31

Bitwise operation and usage

Bitwise operation and usage Consider this code: ``` x = 1 # 0001 x

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-...

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...

11 Feb at 17:40

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

10 Jan at 12:40

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...

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...