splice:当LENGTH的结尾超过数组时,它可以吗?(splice: is it ok when the end of LENGTH is past of the array?)
拼接
是不是可以,当OFFSET在数组中但LENGTH的结尾超过数组的末尾时?
splice
Is it OK, when OFFSET is within the array but the end of LENGTH is past the end of the array?
最满意答案
容易尝试。
$ perl -wE' my @a = "a".."e"; my @b = splice @a, 2, 10; say 0+@b, " elements were removed."; say 0+@a, " elements remain." ' 3 elements were removed. 2 elements remain.我完全相信这不会改变。
Easy to try.
$ perl -wE' my @a = "a".."e"; my @b = splice @a, 2, 10; say 0+@b, " elements were removed."; say 0+@a, " elements remain." ' 3 elements were removed. 2 elements remain.I have every confidence that this will not change.
更多推荐
发布评论