티스토리 뷰

공부

[Kotlin] destructure array

승가비 2022. 6. 6. 02:47
728x90
fun main() {
   val destructureArray = arrayOf("1", "2", "3", "4", "5", "6")
   val (str1, str2, str3,  str4, str5) = destructureArray
   println(str1)
   println(str2)
   println(str3)
   println(str4)
   println(str5)
   
}

https://tedblob.com/kotlin-array-destructuring/

 

Kotlin array destructuring - TedBlob

We will learn about the Array destructuring in Kotlin along with relevant examples. A destructuring declarations provide a convenient way

tedblob.com

 

728x90

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

[Python] remove "" filter(None, lst)  (0) 2022.06.06
[Python] strip in map function  (0) 2022.06.06
[spring] @Cachable  (0) 2022.06.06
[Redis] redis-cli -h 127.0.0.1 -p 6379 FLUSHALL  (0) 2022.05.23
[Javascript] Async & Await  (0) 2022.05.23
댓글