急!!VB字符统计:在文本框中输入一串字符,在下面的列表框中显示出每个26个英文字母出现的次数。
把“?”的地方补上就可以了~~~先谢谢了!PrivateSubCommand1_Click()''''统计文本框中26个英文字符出现的个数DimStrAsStringDi...
把“?”的地方补上就可以了~~~先谢谢了!
Private Sub Command1_Click()
''''统计文本框中26个英文字符出现的个数
Dim Str As String
Dim Count(25) As Integer, Strlen As Integer, index As Integer
Dim ch As String
Str = Text1
Strlen = Len(Str)
''''利用循环将str中每个字符取出来
For i = 1 To Strlen
'ch = UCase(Mid(?))
'index = Asc(ch) -?
If index >= 0 And index <= 25 Then
' Count(index) = Count(index) + ?
End If
Next
For i = 0 To 25
List1.AddItem Chr(65 + i) & " " & Count(i)
Next 展开
Private Sub Command1_Click()
''''统计文本框中26个英文字符出现的个数
Dim Str As String
Dim Count(25) As Integer, Strlen As Integer, index As Integer
Dim ch As String
Str = Text1
Strlen = Len(Str)
''''利用循环将str中每个字符取出来
For i = 1 To Strlen
'ch = UCase(Mid(?))
'index = Asc(ch) -?
If index >= 0 And index <= 25 Then
' Count(index) = Count(index) + ?
End If
Next
For i = 0 To 25
List1.AddItem Chr(65 + i) & " " & Count(i)
Next 展开
1个回答
展开全部
Private Sub Command1_Click()
''''统计文本框中26个英文字符出现的个数
Dim Str As String
Dim Count(25) As Integer, Strlen As Integer, index As Integer
Dim ch As String
Str = Text1
Strlen = Len(Str)
''''利用循环将str中每个字符取出来
For i = 1 To Strlen
ch = UCase(Mid(Str, i, 1))
index = Asc(ch) - 65
If index >= 0 And index <= 25 Then
Count(index) = Count(index) + 1
End If
Next
For i = 0 To 25
List1.AddItem Chr(65 + i) & " " & Count(i)
Next
End Sub
''''统计文本框中26个英文字符出现的个数
Dim Str As String
Dim Count(25) As Integer, Strlen As Integer, index As Integer
Dim ch As String
Str = Text1
Strlen = Len(Str)
''''利用循环将str中每个字符取出来
For i = 1 To Strlen
ch = UCase(Mid(Str, i, 1))
index = Asc(ch) - 65
If index >= 0 And index <= 25 Then
Count(index) = Count(index) + 1
End If
Next
For i = 0 To 25
List1.AddItem Chr(65 + i) & " " & Count(i)
Next
End Sub
百事牛
2024-10-22 广告
2024-10-22 广告
百事牛是共享提供商,我们提供可靠有效的服务,适当合理的授权费有利于的继续更新优化。同样的事情,同样的方法,百事牛团队十年磨一剑,始终至聚焦在密码恢复领域,深耕于此,我们已研制出有别于其他公司的算法和运算模式, 百事牛的暴力模式加入了分布式点...
点击进入详情页
本回答由百事牛提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询