最快要删除阵列中间的一个条目的方式() [英] Fastest way to delete one entry from the middle of Array()

查看:195
本文介绍了最快要删除阵列中间的一个条目的方式()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是删除阵列的中间()

What is the fastest way to delete one specific entry from the middle of Array()

阵列是大是具有字符串。

Array is large one having Strings.

我不想只是设置阵列[5] = NULL,而是数组的大小应该由一个和阵列降低[5]应该有数组[6]的内容等。

I dont want just to set Array[5] = null, but instead array size should be reduced by one and array[5] should have content of array[6] etc.

推荐答案

没有任何标准来支持这一点,但人们会假设本机<一href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/Array.html#splice%28%29">Array.splice方法是最快的...

Don't have any benchmarks to support this, but one would assume that the native Array.splice method would be the fastest...

所以,在索引5删除的条目:

So, to remove the entry at index 5:

array.splice(5, 1);

这篇关于最快要删除阵列中间的一个条目的方式()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆