两个数组的笛卡尔连接
我正在尝试使用 for next 循环来迭代数组并组合其字符串 我只能得到第一个数组。不知道如何编写代码以与第二个数组结合并使用 VB.NET 创建第三个数组。你能帮忙吗?
例如:
arrLetters() As String = {"A", "B", "C", "D", "E", "F", "G", "H", "I"}
arrNumbers() As String = {"1", "2", "3", "4", "5", "6", "7", "8", "9"}
结果数组(81) = {A1, A2 ...A9, B1, B2...B9, ...I9}
I am trying to use a for next loop to iterate through the arrays and combine its strings
I can only get the first array. Don't know how to code to combine with the second one and create the third array using VB.NET. could you help please?
ex:
arrLetters() As String = {"A", "B", "C", "D", "E", "F", "G", "H", "I"}
arrNumbers() As String = {"1", "2", "3", "4", "5", "6", "7", "8", "9"}
resulting array(81) = {A1, A2 ...A9, B1, B2...B9, ...I9}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在 C# 中,它是:
在 VB 中,结果放入数组变量中:
In C# it would be:
In VB, with the result going in to an array variable:
使用下面的逻辑(在 C# 中)
希望这有帮助:)
Use below logic (In C#)
Hope this helps :)