vb中输入i am a boy ,输出boy a am
来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/08/31 05:00:52
vb中输入i am a boy ,输出boy a am
建一个form,里面做个文本框Text1,一个按钮Command1
然后写以下程序.
Private Sub Command1_Click()
Dim arr As Variant
Dim ss As String
Dim i As Integer
If Right(Text1.Text,1) " " Then
Text1.Text = Text1.Text & " "
End If
arr = Split(Text1.Text," ")
For i = UBound(arr) - 1 To 0 Step -1
ss = ss & arr(i) & " "
Next i
MsgBox ss
End Sub
运行以后在文本框里输入一句话然后点击按钮就行了
然后写以下程序.
Private Sub Command1_Click()
Dim arr As Variant
Dim ss As String
Dim i As Integer
If Right(Text1.Text,1) " " Then
Text1.Text = Text1.Text & " "
End If
arr = Split(Text1.Text," ")
For i = UBound(arr) - 1 To 0 Step -1
ss = ss & arr(i) & " "
Next i
MsgBox ss
End Sub
运行以后在文本框里输入一句话然后点击按钮就行了