VB题目:数组输入输出,在文本框text1.text中放入一维数组的5个元素,点击command1
VB题目:数组输入输出,在文本框text1.text中放入一维数组的5个元素,点击command1,将5个元素逆序放入文本框2中。使用arraytotext和textto...
VB题目:数组输入输出,在文本框text1.text中放入一维数组的5个元素,点击command1,将5个元素逆序放入文本框2中。使用array to text 和text to array完成数组与字符串之间的转换。
展开
展开全部
Private Sub Command1_Click()
Text2.Text = 0
Text3.Text = 0
Text4.Text = 0
For i = 1 To Len(Text1.Text)
If Mid(Text1.Text, i, 1) Like "[A-Z]" Or Mid(Text1.Text, i, 1) Like "[a-z]" Then
Text3.Text = Val(Text3.Text) + 1
ElseIf Mid(Text1.Text, i, 1) Like "[0-9]" Then
Text2.Text = Val(Text2.Text) + 1
Else
Text4.Text = Val(Text4.Text) + 1
End If
Next
End Sub
Text2.Text = 0
Text3.Text = 0
Text4.Text = 0
For i = 1 To Len(Text1.Text)
If Mid(Text1.Text, i, 1) Like "[A-Z]" Or Mid(Text1.Text, i, 1) Like "[a-z]" Then
Text3.Text = Val(Text3.Text) + 1
ElseIf Mid(Text1.Text, i, 1) Like "[0-9]" Then
Text2.Text = Val(Text2.Text) + 1
Else
Text4.Text = Val(Text4.Text) + 1
End If
Next
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询