早教吧 育儿知识 作业答案 考试题库 百科 知识分享

foreachxxinxx的前后不一致求解!打个比方:Dimcs()AsStringDimiAsIntegercs=Split("a,b,c,d",",")ForEachcs(i)IncsMessageBox.Show(cs(i))NextForEachcs(i)IncsMessageBox.Show(cs(i))Next按照理解应该是逐个

题目详情
for each xx in xx的前后不一致求解!打个比方: Dim cs() As String Dim i As Integer cs = Split("a,b,c,d", ",") For Each cs(i) In cs MessageBox.Show(cs(i)) Next For Each cs(i) In cs MessageBox.Show(cs(i)) Next 按照理解应该是逐个显示a b c d 然后再是a b c d 结果是显示a b c d 然后再是 d c b d 是哪里需要重置下么!!!!
▼优质解答
答案和解析
你代码写错了吧 Dim cs() As String Dim i As String cs = Split("a,b,c,d", ",") For Each i In cs MessageBox.Show(i) Next For Each i In cs MessageBox.Show(i) Next