C#is关键字的F#等效项是:?.例如:let cat = Animal()if cat :? Animal then printfn "cat is an animal."else printfn "cat is not an animal."My first F# day. If I have this:let cat = Animal()Now how do I check at later stage if cat is Animal?In C#bool b = cat is Animal;In F#? 解决方案 @ildjarn deserves the credit here for answering first, but I'm submitting the answer here so it can be accepted.The F# equivalent of the C# is keyword is :?. For example:let cat = Animal()if cat :? Animal then printfn "cat is an animal."else printfn "cat is not an animal." 这篇关于F#等同于C#中的is关键字?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!