doc : array slicing examples (#7069)
parent
dedb8f7e41
commit
ff26f0539c
|
@ -521,6 +521,8 @@ println(nums[1]) // "2"
|
|||
nums[1] = 5
|
||||
println(nums) // "[1, 5, 3]"
|
||||
|
||||
println(nums[0..2]) // slicing gives an array "[1, 5]"
|
||||
|
||||
println(nums.len) // "3"
|
||||
nums = [] // The array is now empty
|
||||
println(nums.len) // "0"
|
||||
|
|
Loading…
Reference in New Issue