如:abacdefafefsdfwa然后可以得到上边字符串的a为4个那个函数是什么???
解决方案 »
- 如何实现用VBA调去SQL SERVER数据放入Excel-100分
- 2个API问题1获取不到文本框内容2获取command标题总是有特殊字符
- 出个题目玩,散分
- sybase两库连接及读取问题
- 两个控件重叠在一起时的事件问题,怎样让后面的控件响应事件?
- 求职问题,已参加工作或有求职经验的朋友进来帮帮忙,分不够可再加,急~~~~~~~~在线等!!
- 请大家推荐几本好书!up有分!
- 有关调用(reference)-引用 中的问题 急,在线等待
- VB如何取SQL服务器的时间??????
- 如何将数据在自定义类型的变量和字节数组之间转换
- 如何把存放在剪贴板里的图片保存成JPG格式
- 有一行代码运行时间很长,然后程序超时出错,要如何解决呢?
b = Len(a) - Len(Replace(a, "a", ""))
MsgBox b
dim x
x=split(a,"a")
debug.print ubound(x)+1 '
debug.print ubound(x)-1
Public Function str_count(ByVal str1 As String, ByVal str2 As String) As Integer
Dim count As Integer
Dim start As Integer
Dim len_str2 As Integer
count = -1
start = 1
len_str2 = Len(str2)
Do
count = count + 1
start = InStr(start, str1, str2) + len_str2
Loop Until start = len_str2
str_count = count
End Function
Const x = "abacdefafefsdfwa"
MsgBox UBound(Split(x, "a"))
End Sub
dim aa as string
dim x as integer
aa = "abacdefafefsdfwa"
x = Len(a) - Len(Replace(a, "a", ""))x為所要找的字符串的個數
建议提问前先搜索
http://community.csdn.net/Expert/topic/3083/3083428.xml?temp=.4085199