Data update
This commit is contained in:
parent
5150844a7d
commit
4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions
|
|
@ -1,16 +0,0 @@
|
|||
Function CountSubstring(str,substr)
|
||||
CountSubstring = 0
|
||||
For i = 1 To Len(str)
|
||||
If Len(str) >= Len(substr) Then
|
||||
If InStr(i,str,substr) Then
|
||||
CountSubstring = CountSubstring + 1
|
||||
i = InStr(i,str,substr) + Len(substr) - 1
|
||||
End If
|
||||
Else
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
End Function
|
||||
|
||||
WScript.StdOut.Write CountSubstring("the three truths","th") & vbCrLf
|
||||
WScript.StdOut.Write CountSubstring("ababababab","abab") & vbCrLf
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
function CountSubstring(str,substr)
|
||||
with new regexp
|
||||
.pattern=substr
|
||||
.global=true
|
||||
set m=.execute(str)
|
||||
end with
|
||||
CountSubstring =m.count
|
||||
end function
|
||||
WScript.StdOut.Writeline CountSubstring("the three truths","th")
|
||||
WScript.StdOut.Writeline CountSubstring("ababababab","abab")
|
||||
Loading…
Add table
Add a link
Reference in a new issue