티스토리 뷰

공부

[kotlin] if not in (!in)

승가비 2022. 8. 11. 00:23
728x90

https://stackoverflow.com/questions/43664110/kotlin-if-item-not-in-list-proper-syntax

 

Kotlin: "if item not in list" proper syntax

Given Kotlin's list lookup syntax, if (x in myList) as opposed to idiomatic Java, if (myList.contains(x)) how can one express negation? The compiler doesn't like either of these: if (x not in

stackoverflow.com

 

728x90

'공부' 카테고리의 다른 글

[JUnit] @Disabled (as-is @Ignore)  (0) 2022.08.11
[Java] map -> properties `putAll`  (0) 2022.08.11
[kotlin] when(type)  (0) 2022.08.11
[Java] e.printStackTrace -> String  (0) 2022.08.10
[github] actions permissions  (0) 2022.08.10
댓글