Click here to Skip to main content
15,893,594 members
Please Sign up or sign in to vote.
2.33/5 (3 votes)
See more:
Dear All,

Is there any operator === in C#? if yes then how it works and what is its use?

Thanks

Laxman
Posted
Comments
[no name] 8-Sep-11 7:33am    
what this operator used for?

In situations like this, a quick Google or a search on MSDN normally helps. You will get your answers much quicker and learn more if you search for them yourself. Try this page all about C# operators:

http://msdn.microsoft.com/en-us/library/6a71f45d.aspx[^]
 
Share this answer
 
Comments
Mehdi Gholam 8-Sep-11 7:24am    
My 5!
No.
 
Share this answer
 
AFAIK C# don't have "===" operator.
It has = operator which is assignment operator and == operator which is a comparison operator.
 
Share this answer
 
v2
As for you question, the operator your asking about is called strict equality or identity operator and is used in javascript (maybe in flash/flex also).

This operator behaves identically to the equality operators except no type conversion is done, and the types must be the same to be considered equal.

This operator is not available in java as well as c#.

This are intuitive reasons for that, C# provides many operators that serve the purpose of === operator.

a is b

a.Equals(b)

a.ReferenceEquals(b)

For details on the above mentioned keywords and operators check MSDN or contact me.

I hope I was able to solve your problem.

Watch my first article posted on codeproject and comment and vote:
http://www.codeproject.com/KB/HTML/speechinputapi.aspx
or http://blog.robinrizvi.info

Drop me a mail for any comments, suggestions or questions.
mail@robinrizvi.info
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900