computer 版 (精华区)

发信人: windoe (为中国电信做贡献), 信区: program
标  题: VB:怎样取得一个字符串在另外一个字符串中出现的次数
发信站: 听涛站 (Fri Mar 10 19:09:08 2000), 转信

Public Function sCount(String1 As String, String2 As String) As Integer
Dim I As Integer, iCount As Integer
I = 1
Do
If (I > Len(String1)) Then Exit Do
I = InStr(I, String1, String2, vbTextCompare)
If I Then
iCount = iCount + 1
I = I + 2
DoEvents
End If
Loop While I
sCount = iCount
End Function


--By Kammi's SuperPost General Version
--

夜中不能寐,起坐弹鸣琴。
    薄帷鉴明月,清风吹我襟。
孤鸿号外野,翔鸟鸣北林。
    徘徊将何见,忧思独伤心。


[百宝箱] [返回首页] [上级目录] [根目录] [返回顶部] [刷新] [返回]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:0.866毫秒