已知題目...問問google大神吧~
一解為:
http://www.phate.tw/view...?tid=5393 字串陣列解為:
Join—合併陣列中資料
Dim A()={“F11”,”F18”,”F23”,”F56”}
Dim X=Join(A,”<p>”)
X=“F11<p>F18<p>F23<p>F56”
你可以試看看
我的個人解法:
複製程式
Dim Listi1 = Split(TextBox1.Text, ",")
Dim Listi2 = Split(TextBox2.Text, ",")
Dim k As Integer = 0
Dim List1(UBound(Listi1)) As Integer
Dim List2(UBound(Listi2)) As Integer
Dim List3(UBound(Listi1) + UBound(Listi2) + 1) As Integer
For i As Integer = 0 To UBound(List1) : List1(i) = Int(Listi1(i)) : Next
For i As Integer = 0 To UBound(List2) : List2(i) = Int(Listi2(i)) : Next
Array.Sort(List1)
Array.Sort(List2)
For i As Integer = 0 To UBound(List1)
If i = 0 Then : Label1.Text = List1(i) : Else : Label1.Text &= ", " & List1(i) : End If
List3(k) = Int(List1(i)) : k = k + 1
Next
For i As Integer = 0 To UBound(List2)
If i = 0 Then : Label2.Text = List2(i) : Else : Label2.Text &= ", " & List2(i) : End If
List3(k) = Int(List2(i)) : k = k + 1
Next
Array.Sort(List3)
For i As Integer = 0 To UBound(List3)
If i = 0 Then : Label3.Text = List3(i) : Else : Label3.Text &= ", " & List3(i) : End If
Next
執行結果:如附件