Is there an elegant way to check if an object's type belongs to the list of types?

后端 未结 0 1640
走了就别回头了
走了就别回头了 2020-12-19 05:14

When working with strings you can check if a string belongs to a string set like this:

if (a in listOf("ab", "abab")) {
    // do somethin         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题