●一起分享VB源代码◆立即可用于你的工程●你也发布一些经验代码吧
时间:2011-09-07
来源:互联网
要求使用“插入源代码,选择VB方式”,代码要求全测试过能用的
相同的功能,有不少设计思路,有的很简单却运行慢,有的很复杂,却运行速度快,有的代码量又少,速度又快
集百家之长,不管咋样,===能立即拿来用才是最实在的,其实运行一下速度快点慢点,对一般人来说基本没影响
我先分享一些
VB code
相同的功能,有不少设计思路,有的很简单却运行慢,有的很复杂,却运行速度快,有的代码量又少,速度又快
集百家之长,不管咋样,===能立即拿来用才是最实在的,其实运行一下速度快点慢点,对一般人来说基本没影响
我先分享一些
VB code
'┏〓〓〓〓〓〓〓〓〓 FindStrCount,start 〓〓〓〓〓〓〓〓〓┓ '[简介]: '怎样取得一个字符串在另外一个字符串中出现的次数? Function FindStrCount(Str1 As String, FindStr As String) As Long '帮你写函数,帮你写代码,帮你写模块,帮你设计软件 '--需要什么函数或功能,可以联系我。 FindStrCount = UBound(Split(Str1, FindStr)) End Function '┗〓〓〓〓〓〓〓〓〓 FindStrCount,end 〓〓〓〓〓〓〓〓〓┛ '┏〓〓〓〓〓〓〓〓〓 FindCount,start 〓〓〓〓〓〓〓〓〓┓ '[简介]: '怎样取得一个字符串在另外一个字符串中出现的次数? Function FindCount(String1 As String, String2 As String) As Long '帮你写函数,帮你写代码,帮你写模块,帮你设计软件 '--需要什么函数或功能,可以联系我。 Dim I As Long, iCount As Long Dim LenStr As Long Dim LenFind As Integer LenFind = Len(String2) LenStr = Len(String1) I = 1 I = InStr(I, String1, String2, vbTextCompare) While I > 0 iCount = iCount + 1 I = InStr(I + LenFind, String1, String2, vbTextCompare) 'Debug.Print iCount & Chr(9) & I Wend DoEND: FindCount = iCount End Function '┗〓〓〓〓〓〓〓〓〓 FindCount,end 〓〓〓〓〓〓〓〓〓┛
作者: xiaoyao961 发布时间: 2011-09-07
Function FindStrCount(Str1 As String, FindStr As String) As Long
'帮你写函数,帮你写代码,帮你写模块,帮你设计软件
'--需要什么函数或功能,可以联系我。
FindStrCount = (len(str1)-len(replace(str1,findstr,"")))/len(findstr)
End Function
'帮你写函数,帮你写代码,帮你写模块,帮你设计软件
'--需要什么函数或功能,可以联系我。
FindStrCount = (len(str1)-len(replace(str1,findstr,"")))/len(findstr)
End Function
作者: BestBadGod 发布时间: 2011-09-07
引用 1 楼 bestbadgod 的回复:
Function FindStrCount(Str1 As String, FindStr As String) As Long
'帮你写函数,帮你写代码,帮你写模块,帮你设计软件
'--需要什么函数或功能,可以联系我。
FindStrCount = (len(str1)-len(replace(str1,findstr,"")))/len(findstr)
End Funct……
Function FindStrCount(Str1 As String, FindStr As String) As Long
'帮你写函数,帮你写代码,帮你写模块,帮你设计软件
'--需要什么函数或功能,可以联系我。
FindStrCount = (len(str1)-len(replace(str1,findstr,"")))/len(findstr)
End Funct……
这个方法也不错,变则通
作者: xiaoyao961 发布时间: 2011-09-07
VB code
这样的小函数很多,想要什么功能就写什么
Private Function SumHanZi(sFile As String) As Long '返回字符串中含有的汉字个数 Dim s As String, s1 As String, i As Long, j As Long s = sFile For i = 1 To Len(s) s1 = Mid(s, i, 1) If Asc(s1) < 0 Then j = j + 1 Next SumHanZi = j End Function
这样的小函数很多,想要什么功能就写什么
作者: asftrhgjhkjlkttttttt 发布时间: 2011-09-07

作者: li163 发布时间: 2011-09-07
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28