Android Studio – it is possible to fill an array from 0 to n when inizializing?
val generatedArray = IntArray(10) { i -> i + 1 } generatedArray: [1,2,3,4,5,6,7,8,9,10] I want the array to start with 0 [0,1,2,3,4,5,6,7,8,9]
val generatedArray = IntArray(10) { i -> i + 1 } generatedArray: [1,2,3,4,5,6,7,8,9,10] I want the array to start with 0 [0,1,2,3,4,5,6,7,8,9]