Last active
April 26, 2020 15:03
-
-
Save gyugyu90/727f1d3aea613cdd840961d88ff99861 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun main() { | |
val list = listOf("a", "b", "c") | |
if (-1 !in 0..list.lastIndex) { | |
println("-1은 범위 밖에 있네요") | |
} | |
if (list.size !in list.indices) { | |
println("리스트 사이즈가 인덱스 범위 밖에 있네요") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment