好吧,所以目前我有這段代碼,我試着把ss放在引號出現的地方,它說「我要添加SS的位置」,但它沒有工作,所以我看着這個問題,沒有幫助,我來找你們。我搞砸了我的最後一個問題,所以我希望我做些什麼以及這一個,但反正這裏是基於我用我當前的代碼Eric Lippert's blog post將一維數組的字符串轉換爲文本
Public Class Form1
Private Function CartesianProduct(Of T)(ParamArray sequences As T()()) As T()()
' base case:
Dim result As IEnumerable(Of T()) = {New T() {}}
For Each sequence In sequences
Dim s = sequence
' don't close over the loop variable
' recursive case: use SelectMany to build the new product out of the old one
result = From seq In result
From item In s
Select seq.Concat({item}).ToArray()
Next
Return result.ToArray()
End Function
Dim s1 As String() = New String() {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"}
Dim s2 As String() = New String() {"1", "2", "3", "4", "5", "6", "7", "8", "9"}
Dim ss As String()() = CartesianProduct(s1, s1, s2, s2, s2, s2, s1, s1)
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
TextBox1.Text = TextBox1.Text + "000" + "Where I want SS to be added to"
End Sub
末級
您如何期待它在輸出中被格式化? – 2015-02-06 22:20:27
就像文字一樣,如果你看看ss是如何製作的,我希望它與上面使用的順序一起出來,所以一個例子是xx1234xx,我希望它添加到000以前的列表框,所以我可以使用Notepad ++把它製成列表形式 – ImTheTopOfKEK 2015-02-06 22:25:16
我注意到那些是單字符字符串。如果將這些字符定義爲字符,而不是字符串,則實際上可以極大地提高效率。 – 2015-02-07 05:54:29