且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

C#数组问题

更新时间:2022-06-20 01:15:01

嗯,你没有告诉我们碎片的定义,但我相信pieces被作为一个字符串进行delcared,你试图将它用作一个数组。


确保将片段定义为字符串[]。


另外,我不确定为什么你的所有代码都被注释掉了。
Well, you didn''t show us the definition of pieces, but I believe that pieces is delcared as a string, and you are trying to use it as an array.

Make sure that pieces is defined as a string[].

Also, I''m not sure why all your code is commented out.



嗯,你没有向我们展示碎片的定义,但我相信碎片是作为一个字符串,a你试图将它用作数组。


确保将碎片定义为字符串[]。


此外,我''我不确定为什么你的所有代码都被注释掉了。
Well, you didn''t show us the definition of pieces, but I believe that pieces is delcared as a string, and you are trying to use it as an array.

Make sure that pieces is defined as a string[].

Also, I''m not sure why all your code is commented out.



整个事情都崩溃了,我想看看它是否仍然有用而没有这个它只显示一个小的drowdown列表,没有名字,只有一个滚动条和空间名。您是否可以更具体地定义要定义为string []的部分。这不是我的代码,是我之前的人,我对c#一无所知。


这也是唯一使用pieves的地方。你看到的一切都是你得到的一切。

The whole thing was crashing and I wanted to see if it still worked without this and it just displays a small drowdown list with no names but a scroll bar and space for names. Could you be more specific about pieces to be defined as string[]. This isn''t my code it was the guys before me and I am clueless on c#.

Also this is the only place pieves is used. Everything you see is everything you get.


它实际上看起来不像.NET?

之前从未使用过GetLength(),总是刚刚使用.Length


string [] .Length将返回数组中的元素数(数组中的字符串数)

string .Length返回字符串中的字符数。
It actually doesn''t look like .NET?
I''ve never used GetLength() before, always just used .Length

string[] .Length will return the number of elements in the array (number of strings in the array)
string .Length returns the number of characters in the string.