C# - is
c# is
2023-09-14 09:08:10 时间
Checks if an object is compatible with a given type.
An is expression evaluates to true if the provided expression is non-null, and the provided object can be cast to the provided type without causing an exception to be thrown.
The is keyword causes a compile-time warning if the expression is known to always be true or to always be false, but typically evaluates type compatibility at run time.
The is operator cannot be overloaded.
Note that the is operator only considers reference conversions, boxing conversions, and unboxing conversions. Other conversions, such as user-defined conversions, are not considered.
Anonymous methods are not allowed on the left side of the is operator. This exception includes lambda expressions.
相关文章
- 【C#】创建、解析 xml 文件(XmlDocument 方式)
- c# mysql executenonquery_C#与数据库访问技术之ExecuteNonQuery方法
- 【分享】C# 字节帮助类 ByteHelper
- 【已解决】Requested bean is currently in creation: Is there an unresolvable circular reference?
- null函数深入理解Oracle数据库的IS NULL函数(oracle里的is)
- Oracle中IS用法介绍(oracle中is用法)
- Oracle IS变量动态应对各种市场需求(oracle is 变量)
- 基于C#委托的深入分析
- C#正则表达式分解和转换IP地址实例(C#正则表达式大全c#正则表达式语法)
- C#自动给文章关键字加链接实现代码
- c#DateTime常用操作实例(datetime计算时间差)
- c#Invoke和BeginInvoke区别分析
- C#的WEBBROWSER与JS交互小结
- C#实现装箱与拆箱操作简单实例
- C#中lock死锁实例教程