VB.NET中有一個 is , 在C#中也有一個運算子 is,它們的作用并不相同。
我想問問,在VB.NET中有沒有和C#中的 is 相同的運算子或函式?
uj5u.com熱心網友回復:
感覺is在C#中是型別的比較,在vb中相對于=判斷,比如判斷某個變數是否為空:Is Nothing
IsNot Nothing
相對于C#的
== null
!= null
uj5u.com熱心網友回復:
https://docs.microsoft.com/zh-cn/dotnet/visual-basic/language-reference/operators/typeof-operator
result = TypeOf objectexpression Is typename
result = TypeOf objectexpression IsNot typename
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/269632.html
標籤:VB.NET
