【发布时间】:2019-06-08 23:43:42
【问题描述】:
我的代码有问题。我有一个列表框,它有项目(项目数未知)。我的列表框是这样的:
hello my friends
have a good day
how r u?
I will do it
aBcDe
我想将我所有的列表框项目转移到一个字符串数组。之后,我想根据参数对其进行拆分(参数=空格)。所以最后看看数组:
{'hello', 'my', 'friends', 'have', 'a', 'good', 'day', how', 'r', 'u?','I','will ','做','它','aBcDe'}
这是我的代码:
char[] sc={' '};
string[] lb = mylistbox.Items.OfType<string>().ToArray();
int cnt = lb.Length;
for(int c=0; c<cnt; c++)
{
//I want to transfer the last array here.
}
感谢您的回答。
【问题讨论】:
标签: c# arrays winforms split listbox