[kotlin] zip 두 리스트 묶기

loci·2023년 4월 18일

andriod

목록 보기
9/19

zip() 함수를 이용하면 두 개의 리스트를 묶을 수 있다

val listA = listOf("a", "b", "c")
val listB = listOf(1, 2, 3, 4)
println(listA zip listB) // [(a, 1), (b, 2), (c, 3)]
profile
편리한 개발자

0개의 댓글