关于数组的简单问题 [英] simple question about arrays
问题描述
亲爱的,
我想知道,我找不到如何从数组中删除元素。
dim a as string()
a = SomeString.split(",")
for ...
if _string =""那么a.delete ????
...
Dear all,
I am wondering, that I can''t find how to delete an element from an array.
dim a as string()
a=SomeString.split(",")
for ...
if _string="" then a.delete????
...
推荐答案
" Boni" < oilia @ NOSPAM> schrieb:
"Boni" <oilia@nospam> schrieb:
我想知道,我找不到如何从数组中删除一个元素。
dim a as string()
a = SomeString.split( ,,对于......
如果_string =""那么a.delete ????
I am wondering, that I can''t find how to delete an element from an array.
dim a as string()
a=SomeString.split(",")
for ...
if _string="" then a.delete????
你必须创建一个合适大小的新数组并复制
项原始数组使用''Array.Copy''或
''Array.CopyTo''到新数组。
-
MS Herfried K. Wagner
MVP< URL:http://dotnet.mvps.org/>
VB< URL:http: //classicvb.org/petition/>
You''ll have to create a new array of appropriate size and copy over the
items of the original array to the new array using ''Array.Copy'' or
''Array.CopyTo''.
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
很难看。有没有更好的解决方案?如果split(。)返回一个数组,那么
就不能采用其他集合类型。这真的不合适吗?
" Herfried K. Wagner [MVP]" <喜*************** @ gmx.at> schrieb im Newsbeitrag
新闻:%2 **************** @ TK2MSFTNGP10.phx.gbl ...
It is ugly. Is there no better solution? If split(.) returns an array I
can''t take other collection type. Is it really nothing more appropriate?
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> schrieb im Newsbeitrag
news:%2****************@TK2MSFTNGP10.phx.gbl...
"希欧波尼" < oilia @ NOSPAM> schrieb:
"Boni" <oilia@nospam> schrieb:
我想知道,我找不到如何从数组中删除一个元素。
dim a as string()
a = SomeString.split( ,,对于......
如果_string =""然后a.delete ????
I am wondering, that I can''t find how to delete an element from an array.
dim a as string()
a=SomeString.split(",")
for ...
if _string="" then a.delete????
你将不得不创建一个适当大小的新数组,并将原始数组的
项复制到新数组使用''Array.Copy''或
''Array.CopyTo''。
MS Herfried K. Wagner
MVP< URL:http ://dotnet.mvps.org/>
VB< URL:http://classicvb.org/petition/>
You''ll have to create a new array of appropriate size and copy over the
items of the original array to the new array using ''Array.Copy'' or
''Array.CopyTo''.
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
你不能从数组中间删除''元素。您需要使用
集合来实现该功能,或者运行您的阵列,将所有非空的b $ b空白元素复制到另一个阵列中。
Boni写道:
You can''t ''delete'' an element from the middle of an array. You need to use a
collection for that functionality, or run through your array, copying all non
blank elements into another array.
"Boni" wrote:
亲爱的,
我想知道,我找不到如何从数组中删除一个元素。
dim a as string( )
a = SomeString.split(",")
for .....
如果_string =""那么a.delete ????
......
Dear all,
I am wondering, that I can''t find how to delete an element from an array.
dim a as string()
a=SomeString.split(",")
for ...
if _string="" then a.delete????
...
这篇关于关于数组的简单问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!