我正在创建一个程序,用户将输入一组元素示例:“abcd” 并显示输出{a} {b} {c} {a,b} {a,c} {b,c}
我知道在C ++和java中这是可能的,但是当我遇到VB.net问题时我就停止了
我的方法是否正确?或者我应该使用for循环?请帮忙
这是我目前的代码
Public Class Form3
Friend X As Integer
Private Sub btnOK_Click(sender As Object, e As EventArgs) Handles btnOK.Click
If txtelements.Text = String.Empty Then
MessageBox.Show("Please Input an element")
Else
Dim i As Integer = 0
X = txtelements.Text.Length
If i > X Then
Dim Chars As Char() = txtelements.Text.ToCharArray()
MessageBox.Show("{" & Chars(i) & "}")
i = i + 1
Else
End If
End If
End Sub
End Class