如何从数组中删除一定范围的值? [英] How to delete a range of values from an array?
本文介绍了如何从数组中删除一定范围的值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果array = [1, 2, 3, 4, 5, 6, 7, 8, 9]
,
我想从数组中删除一系列元素.
If array = [1, 2, 3, 4, 5, 6, 7, 8, 9]
,
I want to delete a range of elements from array.
例如:我想从该数组中删除索引范围为2..5
的所有元素,结果应为[1, 2, 7, 8, 9]
For example: I want to delete all elements with an index in the range 2..5
from that array, the result should be [1, 2, 7, 8, 9]
谢谢.
推荐答案
查看全文