如何把数组设置为空数组,即长度为0
C#
string[] t = allid.Split(':');
t = null;
这样可以使数组的长度为0
VB:
dim t() as string
redim t(5)
Erase t '释放数组,使其长度为0,就象dim t() as String后一样.
本文介绍了如何将C#和VB中的数组设置为空数组,即长度为0的方法。在C#中,可以通过将数组引用设为null来实现;而在VB中,则可以使用Erase语句来达到相同的效果。
如何把数组设置为空数组,即长度为0
C#
string[] t = allid.Split(':');
t = null;
这样可以使数组的长度为0
VB:
dim t() as string
redim t(5)
Erase t '释放数组,使其长度为0,就象dim t() as String后一样.
1万+
736
5430

被折叠的 条评论
为什么被折叠?
