C#数组问题 [英] C# array issue

查看:103
本文介绍了C#数组问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

展开 | 选择 | Wrap | 行号

推荐答案

嗯,你没有告诉我们碎片的定义,但我相信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.


这篇关于C#数组问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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