输入:AAABBAB
输出:A4B3
输出:A4B3
解决方案 »
- 【紧急跪求】vb 2 vbs脚本的转换
- 如何让我写的VB程序总是当前唯一的活动窗口,菜鸟提问
- 还问个比较有深意的问题哦,这个估计要很难了!听说做不到啊,望大家都来看看!!
- 不知道该怎样表达我的问题,请大家讨论,关于ocx控件
- 请问如何动态加载控件
- crystal report8.0的cd—key?
- VB的两个小问题:1\如何让VB生成的程序自带VB6运行库?2\我用WIN2000+VB6环境编写的程序在WIN98下运行按钮字体及程序上的字体模糊不清,如何
- 请问用哪个API能够得到当前活动窗口的句柄。
- html文件数据保存问题
- 谁能提供获取CMOS中数据(包括显示器型号和序列号)的程序代码.
- 求一维数组第一个非0元素及其下标
- 判断当前获得focus的控件
Const cstVal = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
Dim intI%
Dim m, n
For intI = 0 To Len(cstVal)
strVal = strVal
m = Len(strVal)
strVal = Replace$(strVal, Mid$(cstVal, intI + 1, 1), "")
n = Len(strVal)
If m - n <> 0 Then Check = Check & Mid$(cstVal, intI + 1, 1) & (m - n)
Next
End Function
Content As String
RepeatCount As Long
End Type
Private Sub Command1_Click()MsgBox CharCount("AAABBAB撒四大四大 阿瑟打死的")
End SubFunction CharCount(ByVal strVal As String) As String Dim i As Integer, j As Integer
Dim strCurrentChar As String
Dim CharTypeArray() As CharType
Dim ArrayCount As Integer Dim strRet As String
If Trim(strVal) <> "" Then
For i = 1 To Len(Trim(strVal))
strCurrentChar = Mid(strVal, i, 1)
For j = 1 To ArrayCount
If CharTypeArray(j).Content = strCurrentChar Then
CharTypeArray(j).RepeatCount = CharTypeArray(j).RepeatCount + 1
Exit For
End If
Next
If j > ArrayCount Then
ArrayCount = ArrayCount + 1
ReDim Preserve CharTypeArray(1 To ArrayCount) As CharType
CharTypeArray(ArrayCount).Content = strCurrentChar
CharTypeArray(ArrayCount).RepeatCount = 1
End If
Next
For i = 1 To ArrayCount
strRet = strRet + CharTypeArray(i).Content & CStr(CharTypeArray(i).RepeatCount)
Next
CharCount = strRet
Else
CharCount = ""
End If
End Function